Skip to content

Commit 71de25c

Browse files
authored
Merge pull request #405 from convertcom/fix/ci-auto-dispatch-npm-publish
fix(ci): auto-dispatch npm publish when release-please creates releases
2 parents ad72e7d + 3532a7f commit 71de25c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
permissions:
88
contents: write
99
pull-requests: write
10+
actions: write
1011

1112
jobs:
1213
release:
@@ -17,3 +18,13 @@ jobs:
1718
with:
1819
config-file: release-please-config.json
1920
manifest-file: .release-please-manifest.json
21+
- name: Dispatch npm publish for released packages
22+
if: ${{ steps.release.outputs.releases_created == 'true' }}
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
RELEASE_OUTPUTS: ${{ toJSON(steps.release.outputs) }}
26+
run: |
27+
for tag in $(echo "$RELEASE_OUTPUTS" | jq -r 'to_entries[] | select(.key | endswith("--tag_name")) | .value'); do
28+
echo "Dispatching publish-package.yml for $tag"
29+
gh workflow run publish-package.yml --repo "$GITHUB_REPOSITORY" -f tag="$tag"
30+
done

0 commit comments

Comments
 (0)