From e475f4bf5693d17283235629220f03d2a523a31e Mon Sep 17 00:00:00 2001 From: Siddharth Gelera Date: Sat, 30 May 2026 12:52:32 +0530 Subject: [PATCH] Add follow-up job to commit package version after release. Persist package.json and package-lock.json in the repo once npm staging succeeds. Co-authored-by: Cursor --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c3d1c8..71992ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,8 @@ jobs: name: Stage on npm needs: test runs-on: ubuntu-latest + outputs: + version: ${{ steps.meta.outputs.version }} steps: - name: Checkout uses: actions/checkout@v6 @@ -83,3 +85,42 @@ jobs: - name: Stage package on npm run: npm stage publish + + commit-version: + name: Commit version bump + needs: stage + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + persist-credentials: true + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: 22 + cache: npm + package-manager-cache: false + + - name: Install dependencies + run: npm ci + + - name: Set package version + run: npm version "${{ needs.stage.outputs.version }}" --no-git-tag-version --allow-same-version + + - name: Commit and push version bump + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + if git diff --quiet -- package.json package-lock.json; then + echo "package.json and package-lock.json already match release version; nothing to commit." + exit 0 + fi + + git add package.json package-lock.json + git commit -m "chore(release): bump version to ${{ needs.stage.outputs.version }}" + git push