File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 11name : Deploy
22
33on :
4- release :
5- types : [published]
4+ workflow_dispatch :
5+ inputs :
6+ tag_name :
7+ description : ' Tag name for the release'
8+ required : true
9+ type : string
10+ workflow_call :
11+ inputs :
12+ tag_name :
13+ description : ' Tag name for the release'
14+ required : true
15+ type : string
616
717jobs :
818 deploy :
1222 - name : Checkout
1323 uses : actions/checkout@v4
1424 with :
25+ ref : ${{ inputs.tag_name }}
1526 fetch-depth : 1
1627
1728 - name : Install Node.js
Original file line number Diff line number Diff line change 1919 uses : justincy/github-action-npm-release@2.0.1
2020 id : release
2121 with :
22- token : ${{ secrets.GITHUB_TOKEN }}
22+ token : ${{ secrets.GITHUB_TOKEN }}
23+
24+ - name : Trigger Deploy Workflow
25+ if : steps.release.outputs.released == 'true'
26+ uses : actions/github-script@v7
27+ with :
28+ github-token : ${{ secrets.GITHUB_TOKEN }}
29+ script : |
30+ await github.rest.actions.createWorkflowDispatch({
31+ owner: context.repo.owner,
32+ repo: context.repo.repo,
33+ workflow_id: 'deploy.yml',
34+ ref: 'main',
35+ inputs: {
36+ tag_name: '${{ steps.release.outputs.tag }}'
37+ }
38+ })
You can’t perform that action at this time.
0 commit comments