Skip to content

Commit a1137b4

Browse files
committed
ci: use curl instead of gh
1 parent 261108a commit a1137b4

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -324,29 +324,27 @@ jobs:
324324
325325
- name: Create PR for version bump
326326
if: env.VERSION_UPDATED == 'true' && steps.ff-main.outputs.fast_forward == 'true'
327-
env:
328-
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
329327
run: |
330328
# Check if PR already exists
331-
EXISTING_PR=$(gh pr list --head "${{ env.BUMP_BRANCH }}" --base main --json number --jq '.[0].number' 2>/dev/null || echo "")
329+
EXISTING_PR=$(curl -s -H "Authorization: token ${{ secrets.PAT_TOKEN }}" \
330+
"https://api.github.com/repos/${{ github.repository }}/pulls?head=${{ github.repository_owner }}:${{ env.BUMP_BRANCH }}&base=main" \
331+
| jq -r '.[0].number // empty')
332332
333333
if [ -n "$EXISTING_PR" ]; then
334334
echo "PR #$EXISTING_PR already exists, skipping creation"
335335
else
336-
gh pr create \
337-
--base main \
338-
--head "${{ env.BUMP_BRANCH }}" \
339-
--title "chore: bump version to ${{ env.NEXT_VERSION }}" \
340-
--body "Automatic version bump after release. Prepare ${{ env.NEXT_VERSION }} as next release candidate."
336+
curl -X POST \
337+
-H "Authorization: token ${{ secrets.PAT_TOKEN }}" \
338+
-H "Accept: application/vnd.github.v3+json" \
339+
"https://api.github.com/repos/${{ github.repository }}/pulls" \
340+
-d "{\"title\":\"chore: bump version to ${{ env.NEXT_VERSION }}\",\"head\":\"${{ env.BUMP_BRANCH }}\",\"base\":\"main\",\"body\":\"Automatic version bump after release. Prepare ${{ env.NEXT_VERSION }} as next release candidate.\"}"
341341
fi
342342
343343
- name: Create PR (non fast-forward)
344344
if: steps.ff-main.outputs.fast_forward == 'false'
345-
env:
346-
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
347345
run: |
348-
gh pr create \
349-
--base main \
350-
--head "${GITHUB_REF_NAME}" \
351-
--title "chore: sync version ${{ needs.semantic-version.outputs.version }}" \
352-
--body "Automatic version sync after release v${{ needs.semantic-version.outputs.version }}."
346+
curl -X POST \
347+
-H "Authorization: token ${{ secrets.PAT_TOKEN }}" \
348+
-H "Accept: application/vnd.github.v3+json" \
349+
"https://api.github.com/repos/${{ github.repository }}/pulls" \
350+
-d "{\"title\":\"chore: sync version ${{ needs.semantic-version.outputs.version }}\",\"head\":\"${GITHUB_REF_NAME}\",\"base\":\"main\",\"body\":\"Automatic version sync after release v${{ needs.semantic-version.outputs.version }}.\"}"

0 commit comments

Comments
 (0)