From 26885144ab6da68dce9fc15231a05d73f9b7f7b4 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Sun, 17 May 2026 18:47:22 -0500 Subject: [PATCH 1/3] fix: release branch publishing not to commit to main --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ff742f335..aa5abe83ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,7 @@ env: permissions: contents: write id-token: write + pull-requests: write jobs: release: @@ -40,11 +41,34 @@ jobs: - name: Stop Nx Agents if: ${{ always() }} run: npx nx-cloud stop-all-agents + - name: Prepare Release PR Branch + id: release-branch + run: | + branch="release/${GITHUB_REF_NAME}/version-bump-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" + git switch -c "$branch" + git push --set-upstream origin "$branch" + echo "branch=$branch" >> "$GITHUB_OUTPUT" - name: Publish run: | - git config --global user.name 'Tanner Linsley' - git config --global user.email 'tannerlinsley@users.noreply.github.com' + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' pnpm run cipublish env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: ${{ github.ref_name }} TAG: ${{ inputs.tag }} + - name: Open Version Bump Pull Request + run: | + if [[ "$(git rev-list --count "origin/${GITHUB_REF_NAME}..HEAD")" == "0" ]]; then + echo "No version bump commit was created; skipping pull request." + git push origin --delete "${{ steps.release-branch.outputs.branch }}" + exit 0 + fi + + gh pr create \ + --base "$GITHUB_REF_NAME" \ + --head "${{ steps.release-branch.outputs.branch }}" \ + --title "release: version packages" \ + --body "Automated version bump created after publishing packages." + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c1f4cc622f42d2354e6e98754f2fa59bdf6bce24 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Sun, 17 May 2026 18:53:19 -0500 Subject: [PATCH 2/3] use env var for branch name --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa5abe83ff..bdabd13edd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,14 +61,15 @@ jobs: run: | if [[ "$(git rev-list --count "origin/${GITHUB_REF_NAME}..HEAD")" == "0" ]]; then echo "No version bump commit was created; skipping pull request." - git push origin --delete "${{ steps.release-branch.outputs.branch }}" + git push origin --delete "$RELEASE_BRANCH" exit 0 fi gh pr create \ --base "$GITHUB_REF_NAME" \ - --head "${{ steps.release-branch.outputs.branch }}" \ + --head "$RELEASE_BRANCH" \ --title "release: version packages" \ --body "Automated version bump created after publishing packages." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BRANCH: ${{ steps.release-branch.outputs.branch }} From a25f0e2791a944cfd117c98fb29a30e3e0cba598 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Sun, 17 May 2026 18:57:47 -0500 Subject: [PATCH 3/3] use gh token as env --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdabd13edd..d5095a3043 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,7 @@ concurrency: cancel-in-progress: true env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} permissions: @@ -54,7 +55,6 @@ jobs: git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' pnpm run cipublish env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: ${{ github.ref_name }} TAG: ${{ inputs.tag }} - name: Open Version Bump Pull Request @@ -71,5 +71,4 @@ jobs: --title "release: version packages" \ --body "Automated version bump created after publishing packages." env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RELEASE_BRANCH: ${{ steps.release-branch.outputs.branch }}