From 950e569837fc93ad7b7d34b41af50f346abb2e0a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 3 Apr 2026 15:13:51 +0000 Subject: [PATCH] Fix sync-version-to-dev: create PR instead of direct push The dev branch has branch protection requiring PRs. Changed the sync-version-to-dev job to create a branch and open a PR via gh cli instead of pushing directly to dev. https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7 --- .github/workflows/publish.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 121214a..32d4ced 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,6 +53,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + pull-requests: write steps: - name: Checkout dev uses: actions/checkout@v4 @@ -60,17 +61,26 @@ jobs: ref: dev fetch-depth: 0 - - name: Sync package.json version from main + - name: Sync package.json version from main via PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | MAIN_VERSION=$(git show origin/main:package.json | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).version") DEV_VERSION=$(node -p "require('./package.json').version") if [ "$MAIN_VERSION" != "$DEV_VERSION" ]; then - npm version "$MAIN_VERSION" --no-git-tag-version --allow-same-version + BRANCH="chore/sync-version-${MAIN_VERSION}" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b "$BRANCH" + npm version "$MAIN_VERSION" --no-git-tag-version --allow-same-version git add package.json package-lock.json git commit -m "chore: sync package.json version to $MAIN_VERSION from main" - git push + git push origin "$BRANCH" + gh pr create \ + --base dev \ + --head "$BRANCH" \ + --title "chore: sync package.json version to $MAIN_VERSION from main" \ + --body "Automated version sync from main after release." fi dev-release: