Skip to content

Commit

Permalink
jobs/bump-jenkins-plugins: Create PR against fedora-coreos-pipeline main
Browse files Browse the repository at this point in the history
The `bump-jenkins-plugins` job PR was getting opened against the 'main'
branch of 'coreosbot-releng' - fedora-coreos-pipeline. We are making
changes to open the PR against the 'main' branch of
'coreos' - fedora-coreos-pipeline.
  • Loading branch information
aaradhak committed Nov 26, 2024
1 parent dc58259 commit 070732a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions jobs/bump-jenkins-plugins.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def getVersionFromPluginUrl(pluginUrl) {
def parts = pluginUrl.split("/")
def pluginVersion
if (parts.size() >= 4) {
def groupId = parts[-3]
pluginVersion = parts[-2]
} else {
error("Unable to extract plugin version from the URL.")
Expand Down Expand Up @@ -121,11 +120,16 @@ node {
withCredentials([usernamePassword(credentialsId: botCreds,
usernameVariable: 'GHUSER',
passwordVariable: 'GHTOKEN')]) {
shwrap("""
cd fedora-coreos-pipeline
git push -f https://\${GHUSER}:\${GHTOKEN}@github.com/${fork_repo} main:${pr_branch}
curl -H "Authorization: token ${GHTOKEN}" -X POST -d '{ "title": "${message}", "head": "${pr_branch}", "base": "main" }' https://api.github.com/repos/${fork_repo}/pulls
""")
// Push to the forked repo
shwrap("""
cd fedora-coreos-pipeline
git push -f https://\${GHUSER}:\${GHTOKEN}@github.com/${fork_repo} main:${pr_branch}
""")

// Create a PR against "coreos: fedora-coreos-pipeline:main" repo
def response = shwrapCapture("""
curl -H "Authorization: token ${GHTOKEN}" -X POST -d '{ "title": "${message}", "head": "coreosbot-releng:${pr_branch}", "base": "main" }' https://api.github.com/repos/${repo}/pulls --fail
""")
}
}
}
Expand Down

0 comments on commit 070732a

Please sign in to comment.