generate_prs_flip_draft_to_ready — (#12321)

* Flip draft PRs to ready from the Generate PRs workflow if there is an existing PR in draft and the workflow was not started with PR in Draft Mode selected.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust Linter Handoff workflow git update logic.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2025-08-01 19:24:05 -04:00
committed by GitHub
parent 34c8f78241
commit 13640f5ed3
2 changed files with 3 additions and 3 deletions

View File

@@ -404,13 +404,13 @@ jobs:
if [[ -z ${PR_NUMBER} ]]; then
PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "$(echo "${{ inputs.pr_title || inputs.branch || github.ref_name }}" | sed -e "s/^'//" -e "s/'$//") — ${CHANGED_PACKAGES}" -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev)
else
gh pr edit --title "$(echo "${{ inputs.pr_title || inputs.branch || github.ref_name }}" | sed -e "s/^'//" -e "s/'$//") — ${CHANGED_PACKAGES}" -F /tmp/pr.txt
gh pr edit --add-reviewer chromebrew/active
gh pr edit --add-reviewer chromebrew/active --title "$(echo "${{ inputs.pr_title || inputs.branch || github.ref_name }}" | sed -e "s/^'//" -e "s/'$//") — ${CHANGED_PACKAGES}" -F /tmp/pr.txt
fi
# Draft PRs can not be set to automerge.
if [[ $DRAFT_PR == 'true' ]]; then
gh pr ready --undo || true
else
gh pr ready || true
gh pr merge --auto || true
fi
echo "PR_NUMBER is ${PR_NUMBER}"

View File

@@ -37,7 +37,7 @@ jobs:
with:
fetch-depth: 0
- name: Update branch
if: ${{ github.event.action != 'synchronize' || !contains(github.ref_name, '/merge') }}
if: ${{ !contains(github.ref_name, '/merge') }}
run: |
git fetch origin
git checkout "${{ github.ref_name }}"