Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
permissions:
contents: write
outputs:
committed: ${{ steps.commit-version-bump.outputs.committed }}
committed: ${{ steps.check-changes.outputs.committed }}
new-version: ${{ steps.apply-changesets.outputs.new-version }}
steps:
- name: Notify Slack - Approved
Expand Down Expand Up @@ -118,22 +118,30 @@ jobs:
- name: Update lockfile
run: pnpm install --no-frozen-lockfile

- name: Commit version bump and lockfile
id: commit-version-bump
env:
GITHUB_TOKEN: ${{ steps.releaser.outputs.token }}
NEW_VERSION: ${{ steps.apply-changesets.outputs.new-version }}
- name: Check for a version bump to commit
id: check-changes
run: |
git add -A
if git diff --staged --quiet; then
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit"
echo "committed=false" >> "$GITHUB_OUTPUT"
else
git commit -m "chore: release ${NEW_VERSION} [version bump]"
git push origin main
echo "committed=true" >> "$GITHUB_OUTPUT"
fi

# Commits through the GitHub API so it carries GitHub's signature, which
# the org-wide signed-commits ruleset requires. A plain `git push` is
# rejected.
- name: Commit version bump and lockfile
id: commit-version-bump
if: steps.check-changes.outputs.committed == 'true'
uses: planetscale/ghcommit-action@a6b150b81dca5dd027baa898604418eec9e11465 # v0.2.22
with:
commit_message: 'chore: release ${{ steps.apply-changesets.outputs.new-version }} [version bump]'
repo: ${{ github.repository }}
branch: main
env:
GITHUB_TOKEN: ${{ steps.releaser.outputs.token }}

notify-rejected:
name: Notify Slack - Rejected
needs: [version-bump, notify-approval-needed]
Expand Down
Loading