Skip to content

Commit 130fdf1

Browse files
fix: use PAT for release-please to trigger publish workflow (#86)
The default GITHUB_TOKEN does not trigger downstream workflows when release-please creates a GitHub Release. Use a PAT (RELEASE_PLEASE_TOKEN) so the release:published event fires and triggers the publish workflow naturally. Also remove the now-unnecessary workflow_call workaround.
1 parent ebbe7b9 commit 130fdf1

File tree

2 files changed

+6
-35
lines changed

2 files changed

+6
-35
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7-
workflow_call:
87

98
permissions:
109
id-token: write
@@ -43,8 +42,7 @@ jobs:
4342
needs: check
4443
if: |
4544
(github.event_name == 'release' && startsWith(github.event.release.tag_name, 'v')) ||
46-
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') ||
47-
(github.event_name == 'workflow_call')
45+
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
4846
runs-on: ubuntu-latest
4947
steps:
5048
- name: Checkout code
Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Please
1+
name: release-please
22

33
on:
44
push:
@@ -7,46 +7,19 @@ on:
77
workflow_dispatch:
88

99
permissions:
10-
issues: write # This is important for label creation
1110
contents: write
1211
pull-requests: write
13-
id-token: write # Required for OIDC publishing in called workflow
1412

1513
jobs:
1614
release-please:
1715
runs-on: ubuntu-latest
18-
outputs:
19-
# Don't use release_created this: https://danwakeem.medium.com/beware-the-release-please-v4-github-action-ee71ff9de151
20-
# releases_created: ${{ steps.release.outputs.releases_created }}
21-
# paths_released: ${{ steps.release.outputs.paths_released }}
22-
release_created: ${{ steps.release.outputs.release_created }}
23-
tag_name: ${{ steps.release.outputs.tag_name }}
2416
steps:
25-
- uses: actions/checkout@v4
26-
with:
27-
fetch-depth: 0
2817
- uses: googleapis/release-please-action@v4
2918
id: release
3019
with:
31-
# Use manifest mode for monorepo
20+
# Use a PAT so that the created releases trigger downstream
21+
# workflows (release: published). The default GITHUB_TOKEN does
22+
# not trigger other workflows — this is a GitHub limitation.
23+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
3224
config-file: .release-please-config.json
3325
manifest-file: .release-please-manifest.json
34-
35-
# Debug job to echo release-please outputs
36-
debug-outputs:
37-
needs: release-please
38-
runs-on: ubuntu-latest
39-
steps:
40-
- name: Echo outputs
41-
shell: bash
42-
env:
43-
RELEASE_OUTPUTS: ${{ toJSON(needs.release-please.outputs) }}
44-
run: |
45-
echo "All release-please outputs:"
46-
printf '%s\n' "$RELEASE_OUTPUTS"
47-
48-
# Call the Release workflow as a job
49-
trigger-publish:
50-
if: ${{ needs.release-please.outputs.release_created }}
51-
needs: release-please
52-
uses: ./.github/workflows/publish.yml

0 commit comments

Comments
 (0)