How to get current pull request number (issue_number) #1791
-
I have a repo and I already can create and add labels on GitHub while the Jenkins pipeline is working. But, in my params, I have issue_number (for example 856) hardcoded, I need to get the dynamic number the current pull request in my pipeline. const options = {
owner: args.owner,
repo: args.repo,
issue_number: 856,
labels: ['labelname']
};
octokit.issues.addLabels(options).then(response => console.log('label added: ', response.data)); |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I'm afraid I'm not using Jenkins myself, but usually these builds are triggered by a |
Beta Was this translation helpful? Give feedback.
-
So, I have a way that put this label in all the issue_numbers? |
Beta Was this translation helpful? Give feedback.
-
Would this be of any help? https://github.com/jenkinsci/pipeline-github-plugin#pullrequest |
Beta Was this translation helpful? Give feedback.
Would this be of any help? https://github.com/jenkinsci/pipeline-github-plugin#pullrequest