Skip to content

Commit 83f8569

Browse files
committed
chore: allow publish replay
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
1 parent 9b079e1 commit 83f8569

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,34 @@ on:
55
name: Run Release Please
66
jobs:
77
release-please:
8-
environment: publish
98
runs-on: ubuntu-latest
109
permissions:
1110
contents: write
1211
pull-requests: write
13-
id-token: write
1412

1513
# Release-please creates a PR that tracks all changes
1614
steps:
1715
- uses: google-github-actions/release-please-action@db8f2c60ee802b3748b512940dde88eabd7b7e01 # v3
1816
id: release
1917
with:
2018
command: manifest
21-
token: ${{secrets.GITHUB_TOKEN}}
19+
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
2220
default-branch: main
21+
outputs:
22+
releases_created: ${{ steps.release.outputs.releases_created }}
23+
24+
publish:
25+
needs: release-please
26+
if: ${{ fromJSON(needs.release-please.outputs.releases_created || false) }}
27+
environment: publish
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
id-token: write
2332

33+
steps:
2434
# The logic below handles the npm publication:
2535
- name: Checkout Repository
26-
if: ${{ steps.release.outputs.releases_created }}
2736
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2837
with:
2938
fetch-depth: 0
@@ -34,16 +43,13 @@ jobs:
3443
github_token: ${{ github.token }}
3544
- name: Setup Node
3645
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
37-
if: ${{ steps.release.outputs.releases_created }}
3846
with:
3947
node-version-file: '.nvmrc'
4048
registry-url: 'https://registry.npmjs.org'
4149
cache: 'npm'
4250
- name: Update npm (for OIDC auth)
43-
if: ${{ steps.release.outputs.releases_created }}
4451
run: npm install -g npm@^11.5.1
4552
- name: Build Packages
46-
if: ${{ steps.release.outputs.releases_created }}
4753
run: |
4854
npm install
4955
npm run package
@@ -52,7 +58,6 @@ jobs:
5258
# need to publish all unpublished versions to NPM here
5359
# Our scripts only publish versions that do not already exist.
5460
- name: Publish to NPM
55-
if: ${{ steps.release.outputs.releases_created }}
5661
env:
5762
NPM_CONFIG_PROVENANCE: true
5863
run: npm run publish

0 commit comments

Comments
 (0)