File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,26 @@ concurrency:
1212 cancel-in-progress : false
1313
1414jobs :
15- deploy-main :
15+ check-merge-or-workflow-dispatch :
1616 runs-on : ubuntu-latest
17+ outputs :
18+ deploy : ${{ steps.check.outputs.deploy }}
19+ steps :
20+ - name : Check if PR was merged or workflow is triggered by workflow_dispatch
21+ id : check
22+ run : |
23+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
24+ echo "deploy=true" >> $GITHUB_OUTPUT
25+ elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.merged }}" == "true" ]]; then
26+ echo "deploy=true" >> $GITHUB_OUTPUT
27+ else
28+ echo "deploy=false" >> $GITHUB_OUTPUT
29+ fi
30+
31+ deploy-main :
32+ needs : check-merge-or-workflow-dispatch
1733 name : Deploy changes to main in dev AWS account
18- if : github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == 'true'
34+ if : needs.check-merge-or-workflow-dispatch.outputs.deploy == 'true'
1935
2036 permissions :
2137 id-token : write
You can’t perform that action at this time.
0 commit comments