File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Trigger deploy on comment
2+ on :
3+ issue_comment :
4+ types : [created]
5+ jobs :
6+ if_merged :
7+ if : github.event.issue.pull_request && contains(github.event.comment.body, '/deploy')
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : User has permission to deploy
11+ uses : actions/github-script@v6
12+ with :
13+ script : |
14+ // Check if the user trying to deploy is an authorized user
15+ const creator = context.payload.sender.login
16+ const authorizedHandles = ["mvkaran", "abhinavrajesh"]
17+ if(!authorizedHandles.includes(creator.toLowerCase())) {
18+ core.setFailed("User not authorized to deploy")
19+ }
20+ - name : Trigger build
21+ uses : benc-uk/workflow-dispatch@v1
22+ with :
23+ repo : ${{ secrets.GITHUBINDIA_REPO_NWO }}
24+ workflow : Trigger build when public PR is merged
25+ token : ${{ secrets.PAT }}
26+ inputs : ' {"pr_number": "${{ github.event.issue.number }}", "creator_username": "${{ github.event.issue.user.login }}" }'
You can’t perform that action at this time.
0 commit comments