maint(linux): improve getting PR# in upload-to-debian.sh 🍒 🏠#14785
maint(linux): improve getting PR# in upload-to-debian.sh 🍒 🏠#14785ermshiperete merged 2 commits intostable-18.0from
upload-to-debian.sh 🍒 🏠#14785Conversation
With this change we wait two seconds after creating the PR before trying to get the number of the PR so that GitHub can catch up. Previously recently it wasn't able to get the PR#. Also adjust the commit message and use the new header for skipping tests. Cherry-pick-of: #13890 Build-bot: skip Test-bot: skip
User Test ResultsTest specification and instructions User tests are not required |
upload-to-debian.sh 🍒upload-to-debian.sh 🍒 🏠
linux/scripts/upload-to-debian.sh
Outdated
| ${NOOP} gh pr create --draft --base "${BASE}" --title "${PR_TITLE}" --body "${PR_BODY}" | ||
| sleep 2s | ||
| PR_NUMBER=$(gh pr list --draft --search "${PR_TITLE}" --base "${BASE}" --json number --jq '.[].number') |
There was a problem hiding this comment.
From https://cli.github.com/manual/gh_pr_create:
Upon success, the URL of the created pull request will be printed.
Could we just parse that out? It should be easy enough because the URL is pretty stable, e.g.:
https://github.com/keymanapp/keyman/pull/14785
| ${NOOP} gh pr create --draft --base "${BASE}" --title "${PR_TITLE}" --body "${PR_BODY}" | |
| sleep 2s | |
| PR_NUMBER=$(gh pr list --draft --search "${PR_TITLE}" --base "${BASE}" --json number --jq '.[].number') | |
| PR_URL=$(gh pr create --draft --base "${BASE}" --title "${PR_TITLE}" --body "${PR_BODY}") | |
| PR_NUMBER="${PR_URL##*/}" |
I am not sure about the NOOP interactions, but then on a no-op, isn't getting PR_NUMBER going to fall over anyway?
There was a problem hiding this comment.
Excellent idea to do it this way. I didn't know/notice that it only spits out the URL if you assign it to a variable.
| "Cherry-pick-of: #${PR_NUMBER} | ||
| Test-bot: skip" |
There was a problem hiding this comment.
Do you want to add Build-bot commands too? Is a build needed?
linux/scripts/upload-to-debian.sh
Outdated
| COMMIT_MESSAGE="chore(linux): Update debian changelog" | ||
| git commit -m "${COMMIT_MESSAGE}" | ||
| push_to_github_and_create_pr chore/linux/changelog "${DEPLOY_BRANCH#origin/}" "${COMMIT_MESSAGE}" "@keymanapp-test-bot skip" | ||
| push_to_github_and_create_pr chore/linux/changelog "${DEPLOY_BRANCH#origin/}" "${COMMIT_MESSAGE} 🏠" "Test-bot: skip" |
- directly get PR# from `gh pr create` - add `Build-bot: skip` trailers Build-bot: skip Test-bot: skip
|
Changes in this pull request will be available for download in Keyman version 18.0.242 |
- directly get PR# from `gh pr create` - add `Build-bot: skip` trailers - 🍒-pick of the improved 🍒-pick keymanapp#14785 Cherry-pick-of: keymanapp#14785 Build-bot: skip Test-bot: skip
With this change we wait two seconds after creating the PR before trying to get the number of the PR so that GitHub can catch up. Previously recently it wasn't able to get the PR#.
Also adjust the commit message and use the new header for skipping tests.
Cherry-pick-of: #13890
Build-bot: skip
Test-bot: skip