Skip to content

Commit 7eb261e

Browse files
committed
Create PRs as drafts to prompt maintainers to trigger PR checks
PR checks won't be triggered on PRs created by Actions workflows. Therefore mark PRs created by workflows as draft to prompt maintainers to take the PR out of draft, thereby triggering PR checks.
1 parent 33927cc commit 7eb261e

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

.github/update-release-branch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def open_pr(repo, all_commits, short_main_sha, branch_name):
9393
title = 'Merge ' + MAIN_BRANCH + ' into ' + LATEST_RELEASE_BRANCH
9494

9595
# Create the pull request
96-
pr = repo.create_pull(title=title, body='\n'.join(body), head=branch_name, base=LATEST_RELEASE_BRANCH)
96+
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that
97+
# a maintainer can take the PR out of draft, thereby triggering the PR checks.
98+
pr = repo.create_pull(title=title, body='\n'.join(body), head=branch_name, base=LATEST_RELEASE_BRANCH, draft=True)
9799
print('Created PR #' + str(pr.number))
98100

99101
# Assign the conductor

.github/workflows/post-release-mergeback.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,14 @@ jobs:
106106
git commit -m "Update changelog and version after $VERSION"
107107
npm version patch
108108
109-
# when running this workflow on a PR, this is just a test.
110-
# so put into draft mode.
111-
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
112-
DRAFT="--draft"
113-
else
114-
DRAFT=""
115-
fi
116-
117109
git push origin "$NEW_BRANCH"
110+
111+
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
112+
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
118113
gh pr create \
119114
--head "$NEW_BRANCH" \
120115
--base "$BASE_BRANCH" \
121116
--title "$PR_TITLE" \
122117
--label "Update dependencies" \
123118
--body "$PR_BODY" \
124-
${DRAFT:+"$DRAFT"} # no quotes around $DRAFT. gh will error out if there is an empty ""
119+
--draft

.github/workflows/update-release-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install PyGithub==1.51 requests
30+
pip install PyGithub==1.55 requests
3131
3232
- name: Update git config
3333
run: |

0 commit comments

Comments
 (0)