3636 build :
3737 runs-on : ubuntu-latest
3838 steps :
39- - uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
39+ - uses : actions/checkout@v5
4040 - uses : actions/setup-node@v4
4141 with :
4242 node-version : lts/*
6464 run : |
6565 git config --global core.autocrlf false
6666 git config --global core.eol lf
67- - uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
67+ - uses : actions/checkout@v5
6868 - uses : actions/setup-node@v4
6969 with :
7070 node-version : ${{ matrix.node }}
@@ -77,28 +77,30 @@ jobs:
7777 # only run if opt-in during workflow_dispatch
7878 if : always() && github.event.inputs.release == 'true' && needs.build.result != 'failure' && needs.test.result != 'failure' && needs.test.result != 'cancelled'
7979 runs-on : ubuntu-latest
80+ permissions :
81+ id-token : write
8082 steps :
81- - uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
83+ - uses : actions/create-github-app-token@v2
84+ id : app-token
8285 with :
83- # Need to fetch entire commit history to
84- # analyze every commit since last release
86+ app-id : ${{ secrets.ECOSPARK_APP_ID }}
87+ private-key : ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
88+ - uses : actions/checkout@v5
89+ with :
90+ # Need all history to analyze commits since last release
8591 fetch-depth : 0
92+ # Uses generated token to allow pushing commits back
93+ token : ${{ steps.app-token.outputs.token }}
94+ # Make sure GITHUB_TOKEN will not be persisted in repo's config
95+ persist-credentials : false
8696 - uses : actions/setup-node@v4
8797 with :
8898 node-version : lts/*
8999 cache : npm
90100 - run : npm ci
91101 # Branches that will release new versions are defined in .releaserc.json
92102 - run : npm run release
93- # Don't allow interrupting the release step if the job is cancelled, as it can lead to an inconsistent state
94- # e.g. git tags were pushed but it exited before `npm publish`
95- if : always()
96- env :
97- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98- NPM_TOKEN : ${{ secrets.NPM_PUBLISH_TOKEN }}
99- # Re-run semantic release with rich logs if it failed to publish for easier debugging
100- - run : npm run release -- --dry-run --debug
101- if : failure()
102103 env :
103- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104- NPM_TOKEN : ${{ secrets.NPM_PUBLISH_TOKEN }}
104+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
105+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
106+ NPM_CONFIG_PROVENANCE : true
0 commit comments