Skip to content

Commit ac7807d

Browse files
Copilotwoodruffw
andcommitted
Replace peter-evans/create-pull-request with gh pr create
Co-authored-by: woodruffw <[email protected]>
1 parent 96de51a commit ac7807d

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/pin-requirements.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,17 @@ 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+
if ! gh pr create \
138+
--title "Update pinned requirements for ${SIGSTORE_RELEASE_TAG}" \
139+
--body "Pins dependencies for <https://github.com/sigstore/sigstore-python/releases/tag/${SIGSTORE_RELEASE_TAG}>." \
140+
--base main \
141+
--head "${SIGSTORE_PIN_REQUIREMENTS_BRANCH}"; then
142+
# PR already exists, update it
143+
gh pr edit "${SIGSTORE_PIN_REQUIREMENTS_BRANCH}" \
144+
--title "Update pinned requirements for ${SIGSTORE_RELEASE_TAG}" \
145+
--body "Pins dependencies for <https://github.com/sigstore/sigstore-python/releases/tag/${SIGSTORE_RELEASE_TAG}>."
146+
fi

0 commit comments

Comments
 (0)