11name : Release
22
3- on : [push]
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - next
48
59jobs :
610 release :
11+ permissions :
12+ contents : write # to create release (changesets/action)
13+ pull-requests : write # to create pull request (changesets/action)
14+ id-token : write # required for provenance and oidc publish
15+
16+ # prevents this action from running on forks
17+ if : github.repository == 'storybookjs/mcp'
18+
19+ name : Release
720 runs-on : ubuntu-latest
8- if : " !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
9- steps :
10- - uses : actions/checkout@v2
1121
12- - name : Prepare repository
13- run : git fetch --unshallow --tags
22+ steps :
23+ # see https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
24+ - uses : actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
25+ id : app-token
26+ with :
27+ app-id : ${{ vars.STORYBOOK_BOT_APP_ID }}
28+ private-key : ${{ secrets.STORYBOOK_BOT_APP_PRIVATE_KEY }}
1429
15- - name : Use Node.js 14.x
16- uses : actions/setup-node@v1
30+ - name : Checkout
31+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1732 with :
18- node-version : 14.x
33+ # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
34+ fetch-depth : 0
1935
20- - name : Install dependencies
21- uses : bahmutov/npm- install@v1
36+ - name : Setup Node.js and Install Dependencies
37+ uses : ./.github/actions/setup-node-and- install
2238
23- - name : Create Release
39+ - name : Create Release Pull Request or Publish to npm
40+ id : changesets
41+ uses : changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
42+ with :
43+ publish : pnpm release
44+ commitMode : github-api
2445 env :
25- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
27- run : |
28- yarn release
46+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
0 commit comments