Skip to content

Commit 10c2bb0

Browse files
Copilotwoodruffw
andauthored
CI: Replace peter-evans/create-pull-request with gh pr create (#1625)
Co-authored-by: woodruffw <3059210+woodruffw@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: William Woodruff <william@trailofbits.com>
1 parent 6f8a759 commit 10c2bb0

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/pin-requirements.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,21 @@ jobs:
130130
git push -f origin "origin/main:${SIGSTORE_PIN_REQUIREMENTS_BRANCH}"
131131
132132
- name: Open pull request
133-
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
134-
with:
135-
title: |
136-
Update pinned requirements for ${{ env.SIGSTORE_RELEASE_TAG }}
137-
body: |
138-
Pins dependencies for <https://github.com/sigstore/sigstore-python/releases/tag/${{ env.SIGSTORE_RELEASE_TAG }}>.
139-
base: main
140-
branch: ${{ env.SIGSTORE_PIN_REQUIREMENTS_BRANCH }}
141-
delete-branch: true
133+
env:
134+
GH_TOKEN: ${{ github.token }}
135+
run: |
136+
# Try to create a new PR, or update if it already exists
137+
# NOTE: Branch deletion after merge is handled by repository settings
138+
PR_TITLE="Update pinned requirements for ${SIGSTORE_RELEASE_TAG}"
139+
PR_BODY="Pins dependencies for <https://github.com/sigstore/sigstore-python/releases/tag/${SIGSTORE_RELEASE_TAG}>."
140+
141+
if ! gh pr create \
142+
--title "${PR_TITLE}" \
143+
--body "${PR_BODY}" \
144+
--base main \
145+
--head "${SIGSTORE_PIN_REQUIREMENTS_BRANCH}"; then
146+
# PR already exists, update it
147+
gh pr edit "${SIGSTORE_PIN_REQUIREMENTS_BRANCH}" \
148+
--title "${PR_TITLE}" \
149+
--body "${PR_BODY}"
150+
fi

0 commit comments

Comments
 (0)