You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/configure-ci-cd-pipeline/triggers/git-triggers.md
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ max-width="50%"
67
67
68
68
**Support pull request events from forks* - toggle that is useful for open source projects.
69
69
**Branch Field* - this is a regular expression and will only trigger for branches that match this naming pattern.
70
-
**PR CommentField* - useful for open source projects.
70
+
**PR Comment(restricted) and PR Comment Fields* - useful for open source projects.
71
71
**Pull Request Target* branch - this is a regular expression and will trigger only when a Pull request is created against any branch that matches it.
72
72
**Modified Files* - allows you to constrain the build and trigger it only if the modified files from the commit match this[glob expression](https://en.wikipedia.org/wiki/Glob_(programming)).
73
73
@@ -109,25 +109,38 @@ Notice also that you can use Negative Lookahead in your Branch (Regex Expression
109
109
This will make all push-events (including tags) that do follow the`tag...` pattern to be excluded.
110
110
Therefore, all tags like`tag1`,`tag-X`**won't** trigger the pipeline.
111
111
112
-
###Support for building pull requestsfromforks
112
+
###Pull Requestsfromcomments
113
113
114
-
By default, the Git trigger works for events comingfromyour personal repository. You can also use triggers from events thatarecoming from forks. This is a very useful featureforopen source projects, as it allows you to run your own unit testsandother checks against a new feature*before* actually merging it in your repo.
114
+
Pull Requestsfromcommentsaresupportedforall Git providers, for privateandpublic repositories.
115
115
116
-
To enable this behavior:
116
+
**Pull request comment added (restricted)**
117
+
This option triggers an event only when the PR comments are made by repository owners or collaborators.
117
118
118
-
* Toggle the*support pull request events from forks* switch
119
-
* According to the restrictions to enforce based on the type of user who made the PR comment, select either:
120
-
**Pull request comment added (restricted)*: For all Git providers. To trigger only when the PR comments are made by repository owners or collaborators.
121
-
**Pull request comment added*: For GitHub only. To trigger when PR comments are made by any user, regardless of their permissions. We strongly recommend selecting this option only for_private repositories_.
119
+
**Pull request comment added**
120
+
This option triggers an event when PR comments are made by any user, regardless of their permissions.
121
+
Because it is not restricted to owners and collaborators, this option is useful in GitHub, to enable triggers for PR comments made by users in GitHub teams.
122
122
123
-
{% include image.html
123
+
>We strongly recommend selecting this option only for_private repositories_.
By default, the Git trigger works for events coming from your personal repository. You can also use triggers from events that are coming from forks. This is a very useful feature for open source projects, as it allows you to run your own unit tests and other checks against a new feature*before* actually merging it in your repo.
139
+
140
+
To enable this behavior:
141
+
142
+
* Toggle the*support pull request events from forks* switch
143
+
* Select*Pull request comment added (restricted)*
131
144
* In the*pr comment* field enter a custom string (accepts regex)
132
145
133
146
Then once a contributor creates a fork of your repository and submits a pull request, you can review the code and then add a comment on your own that matches the PR comment expression.
@@ -145,22 +158,13 @@ Once that is done, Codefresh will launch your pipeline against the Pull Request.
145
158
146
159
When supporting building of pull requests from forks there are a few "gotchas" to look out for:
147
160
148
-
149
-
150
-
**Pull request comment added (restricted)**
151
-
152
-
This is the default option for triggers based on PR comments, for all Git providers.
153
-
154
-
* Only comments made by repository owners and[collaborators](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/adding-outside-collaborators-to-repositories-in-your-organization) will result in the pipeline being triggered
161
+
* Only comments made by repository owners and[collaborators](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/adding-outside-collaborators-to-repositories-in-your-organization) will result in the pipeline being triggered.
155
162
* Only git pushes by collaborators within the GitHub organization will result in the pipeline being triggered
156
163
* If the repository is in a GitHub organization, comments made by private members of the organization will not activate the trigger, even if they are set as an owner or collaborator. Private members means that they need to be explicitly added to the repository.
157
164
Access cannot be "inherited" by the GitHub team. Currently, only comments from Admins, or Collaborators (directly added, not via teams) are allowed, in order to be caught by this filter.
158
165
* The*Pull request comment added* checkbox should likely be the only one checked, or your pipeline may trigger on other events that you don't anticipate.
159
166
160
-
**Pull request comment added**
161
-
This option is recommended only for GitHub, as the default behavior does not trigger build when comments are made by users in GitHub teams, even Admin users.
162
167
163
-
>Select this only for private GitHub repositories.