File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Deploy"
2+
3+ on : [push, workflow_dispatch]
4+
5+ jobs :
6+ deploy :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - name : Deploy
10+ run : |
11+ echo "Deploying..."
Original file line number Diff line number Diff line change 1+ name : " Update other"
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ update-other :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Update other branch
11+ uses : actions/github-script@v5
12+ with :
13+ script : |
14+ github.rest.git.updateRef({
15+ owner: context.repo.owner,
16+ repo: context.repo.repo,
17+ ref: 'heads/other',
18+ sha: context.sha,
19+ })
20+
21+ # If e.g. you have a deploy workflow that should be triggered
22+ # on the 'other' branch when it is pushed to.
23+ - name : Trigger deploy workflow
24+ uses : actions/github-script@v5
25+ with :
26+ script : |
27+ github.rest.actions.createWorkflowDispatch({
28+ owner: context.repo.owner,
29+ repo: context.repo.repo,
30+ workflow_id: 'deploy.yml',
31+ ref: 'other',
32+ })
You can’t perform that action at this time.
0 commit comments