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
29 changes: 19 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,31 @@ name: release
on:
push:
branches: [main]
# The workflow token only reads. Every write (the Release commit, the v* tag,
# the GitHub release and its comments) uses a token minted from the release
# GitHub App, which is the one actor allowed to push to protected main and to
# create v* tags.
permissions:
contents: write # commit the version bump + tag, push, create the release
contents: read
id-token: write # npm OIDC trusted publishing + provenance
issues: write
pull-requests: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history + tags for version analysis
# The checkout's saved credentials are what `git push` uses, so they
# must be the App's, not the workflow token's.
token: ${{ steps.app-token.outputs.token }}
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
Expand All @@ -25,10 +35,9 @@ jobs:
- run: pnpm install --frozen-lockfile
- run: pnpm exec semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The release commit is authored and committed by whoever made the commit that
# triggered this release (the merge or push to main), not a fixed identity.
GIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
GIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
GIT_COMMITTER_NAME: ${{ github.event.head_commit.author.name }}
GIT_COMMITTER_EMAIL: ${{ github.event.head_commit.author.email }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# The release commit is the App's work, so it is authored as the App's bot.
GIT_AUTHOR_NAME: agenttrail-public-release[bot]
GIT_AUTHOR_EMAIL: 338791256+agenttrail-public-release[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: agenttrail-public-release[bot]
GIT_COMMITTER_EMAIL: 338791256+agenttrail-public-release[bot]@users.noreply.github.com
Loading