File tree Expand file tree Collapse file tree 4 files changed +11
-0
lines changed
main/groovy/javaposse/jobdsl/dsl/helpers/triggers
test/groovy/javaposse/jobdsl/dsl/helpers/triggers Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1379,6 +1379,7 @@ pullRequest {
13791379 useGitHubHooks(boolean useGithubHooks = true) // defaults to false if not specified
13801380 permitAll(boolean permitAll = true) // defaults to false if not specified
13811381 autoCloseFailedPullRequests(boolean autoCloseFailedPullRequests = true) // defaults to false if not specified
1382+ commentFilePath(String commentFilePath) // post the content of the commentFile on the pull request as comment
13821383}
13831384```
13841385
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ class PullRequestBuilderContext implements Context {
1212 boolean useGitHubHooks = false
1313 boolean permitAll = false
1414 boolean autoCloseFailedPullRequests = false
15+ String commentFilePath = ' '
1516
1617 void admin (String admin ) {
1718 admins << admin
@@ -47,6 +48,10 @@ class PullRequestBuilderContext implements Context {
4748 this . cron = cron
4849 }
4950
51+ void commentFilePath (String commentFilePath ) {
52+ this . commentFilePath = commentFilePath
53+ }
54+
5055 void triggerPhrase (String triggerPhrase ) {
5156 this . triggerPhrase = triggerPhrase
5257 }
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ class TriggerContext implements Context {
135135 * <useGitHubHooks>true</useGitHubHooks>
136136 * <permitAll>true</permitAll>
137137 * <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
138+ * <commentFilePath>$WORKSPACE/myCommentFile.log</commentFilePath>
138139 * </org.jenkinsci.plugins.ghprb.GhprbTrigger>
139140 */
140141 void pullRequest (@DslContext (PullRequestBuilderContext ) Closure contextClosure ) {
@@ -152,6 +153,7 @@ class TriggerContext implements Context {
152153 useGitHubHooks pullRequestBuilderContext. useGitHubHooks
153154 permitAll pullRequestBuilderContext. permitAll
154155 autoCloseFailedPullRequests pullRequestBuilderContext. autoCloseFailedPullRequests
156+ commentFilePath pullRequestBuilderContext. commentFilePath
155157 }
156158 }
157159
Original file line number Diff line number Diff line change @@ -315,6 +315,7 @@ class TriggerContextSpec extends Specification {
315315 adminlist[0 ]. value() == ' '
316316 whitelist[0 ]. value() == ' '
317317 orgslist[0 ]. value() == ' '
318+ commentFilePath[0 ]. value() == ' '
318319 }
319320
320321 }
@@ -348,6 +349,7 @@ class TriggerContextSpec extends Specification {
348349 useGitHubHooks(true )
349350 permitAll(true )
350351 autoCloseFailedPullRequests(true )
352+ commentFilePath(' myCommentFile' )
351353 }
352354
353355 then :
@@ -364,6 +366,7 @@ class TriggerContextSpec extends Specification {
364366 useGitHubHooks[0 ]. value() == true
365367 permitAll[0 ]. value() == true
366368 autoCloseFailedPullRequests[0 ]. value() == true
369+ commentFilePath[0 ]. value() == ' myCommentFile'
367370 }
368371 }
369372
You can’t perform that action at this time.
0 commit comments