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
12 changes: 11 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
name: NPM Publish Package

on:
# "published" fires whether a release is created directly or finalized from a
# draft (softprops/action-gh-release creates a draft, then finalizes it).
release:
types: [created]
types: [published]
# Manual fallback to publish an existing tag, e.g. if a release run was missed.
workflow_dispatch:
inputs:
tag:
description: "Tag to publish, e.g. v3.0.0"
required: true

permissions:
id-token: write # Required for OIDC
Expand All @@ -13,6 +21,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}

- uses: actions/setup-node@v4
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,7 @@ jobs:
target_commitish: ${{ steps.bump.outputs.sha }}
name: Release v${{ steps.version.outputs.version }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# Must be the `token` input: the action ignores a GITHUB_TOKEN env var
# and would create the release as github-actions[bot], whose events
# don't trigger npm-publish.yml.
token: ${{ secrets.RELEASE_TOKEN }}
Loading