Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
branches:
- main
workflow_dispatch:
inputs:
message:
type: string
description: 'Overrides the publish commit subject. A publish is a snapshot, so when several commits piled up since the last run the newest subject alone undersells them.'
required: false
default: ''

permissions: {}

Expand All @@ -17,10 +23,15 @@ jobs:
runs-on: ubuntu-slim
environment: release-branch
permissions:
contents: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
# GITHUB_TOKEN cannot create or update files under .github/workflows --
# the `workflows` permission is not grantable to it. The release branch
# carries repository-check.yml, so the push needs a PAT that has it.
token: ${{ secrets.RELEASE_BRANCH_TOKEN }}

- name: Setup PNPM
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
Expand All @@ -41,6 +52,7 @@ jobs:
env:
BRANCH: release
SHA: ${{ github.sha }}
MESSAGE: ${{ inputs.message }}
GIT_USER_NAME: ${{ github.actor }}
GIT_USER_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
WORKFLOW_FILES: repository-check.yml
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if git diff --cached --quiet; then
fi

# $SHA must already be a resolved commit hash, not a ref like "HEAD"
git -c user.name="$GIT_USER_NAME" -c user.email="$GIT_USER_EMAIL" commit -m "publish: $(git log -1 --format=%s "$SHA")"
git -c user.name="$GIT_USER_NAME" -c user.email="$GIT_USER_EMAIL" commit -m "publish: ${MESSAGE:-$(git log -1 --format=%s "$SHA")}"
git push origin "$BRANCH"

# An empty $TAGS would otherwise turn `git push origin --force $TAGS` into
Expand Down