jenkinsci / pipeline-github-plugin

Pipeline: GitHub
https://plugins.jenkins.io/pipeline-github/
MIT License
159 stars 73 forks source link

Added Label added trigger to plugin #121

Closed xocasdashdash closed 1 year ago

xocasdashdash commented 1 year ago

Added support to define a labelAddedTrigger (this is something we need to support), this could be generalized to any label event if it was required, but I feel like this is the most common usecase.

Potentially this can be extended to support a regex instead of a list (I'm open to do that as it seems simple enough). This is now supported.

Opening the PR early in order to get feedback and I know that there's a CI for PRs that generates artifacts, so i could easily test this out in our jenkins instance.

Should fix part of https://github.com/jenkinsci/pipeline-github-plugin/issues/72 but in order to fully fix it it'd need to support regexes.

Testing done

Set it up locally on our jenkins server and added a trigger, with the following syntax:

triggers {
    issueCommentTrigger('.*test this please.*')
    labelAddedTrigger('test-label')
}

and it worked.

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
xocasdashdash commented 1 year ago

@aaronwalker can you take a look into this PR? i've tested it on my jenkins and it works

aaronwalker commented 1 year ago

@xocasdashdash thanks for the contribution!!!!!! I will review this PR and look to get it merged. In meantime can you also test the incrementals build for this PR https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/pipeline-github/2.8-151.33e86903fbb8/

xocasdashdash commented 1 year ago

@aaronwalker did that already and it's working! :)