File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ name: GitHub Packages
22
33# Mirrors published releases to GitHub Packages (npm.pkg.github.com) so the
44# package is listed on the organization packages page. The primary registry
5- # remains npmjs.org; this publication is a courtesy mirror. Runs automatically
6- # when a GitHub release is published and can be triggered manually for an
7- # existing tag.
5+ # remains npmjs.org; this publication is a courtesy mirror. Dispatched by the
6+ # Release workflow after a successful release (a `release: published` trigger
7+ # would never fire, since releases are created with GITHUB_TOKEN and GitHub
8+ # suppresses workflow triggers from such events) and can be triggered manually
9+ # for an existing tag.
810on :
9- release :
10- types : [published]
1111 workflow_dispatch :
1212 inputs :
1313 tag :
2727 # The raw value is passed through the environment (never interpolated
2828 # into the shell) and strictly validated before being used as a ref.
2929 env :
30- TAG_INPUT : ${{ inputs.tag || github.event.release.tag_name }}
30+ TAG_INPUT : ${{ inputs.tag }}
3131 run : |
3232 set -euo pipefail
3333 if ! printf '%s' "$TAG_INPUT" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$'; then
Original file line number Diff line number Diff line change 1919 type : string
2020
2121permissions :
22+ actions : write # dispatch the GitHub Packages mirror workflow
2223 contents : write
2324 id-token : write # npm trusted publishing and provenance
2425
@@ -138,3 +139,8 @@ jobs:
138139 --notes-file release-notes.md \
139140 $prerelease
140141 echo "Released $TAG: ${{ github.server_url }}/${{ github.repository }}/releases/tag/$TAG"
142+
143+ - name : Mirror to GitHub Packages
144+ env :
145+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
146+ run : gh workflow run github-packages.yaml -f "tag=$TAG"
You can’t perform that action at this time.
0 commit comments