From ef610e2ffdfd9cda58bfed36a260e8d1f94ea4be Mon Sep 17 00:00:00 2001 From: Jens Geudens Date: Thu, 30 Apr 2026 20:52:01 +0200 Subject: [PATCH] Fix workflow push and PR creation permissions Add workflows: write permission to allow pushing to branches containing workflow files, force-push to handle stale branches from failed runs, and || true on gh pr create to skip if the PR already exists. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/update-version.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index c9063b4..feaa07a 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -11,6 +11,7 @@ jobs: permissions: contents: write pull-requests: write + workflows: write steps: - name: Checkout uses: actions/checkout@v6.0.2 @@ -46,10 +47,10 @@ jobs: git checkout -b "$branch" git add updater/version.json index.html git commit -m "Update version to ${new_tag}" - git push -u origin "$branch" + git push -u origin "$branch" --force gh pr create \ --title "Update version to ${new_tag}" \ --body "Automated update: bumps all version references and \`updater/version.json\` to [${new_tag}](${html_url})." \ --base main \ - --head "$branch" + --head "$branch" || true