Skip to content

Commit

Permalink
Merge pull request #1098 from AbhinavRajesh/main
Browse files Browse the repository at this point in the history
chore: Updated the workflow flow for the deployment of the githubindia website
  • Loading branch information
Abhinav Rajesh authored May 22, 2023
2 parents e0ab1d4 + 35554f5 commit cde7f50
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/trigger-build.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/trigger-deploy-on-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Trigger deploy on comment
on:
issue_comment:
types: [created]
jobs:
if_merged:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/deploy')
runs-on: ubuntu-latest
steps:
- name: User has permission to deploy
uses: actions/github-script@v6
with:
script: |
// Check if the user trying to deploy is an authorized user
const creator = context.payload.sender.login
const authorizedHandles = ["mvkaran", "abhinavrajesh"]
if(!authorizedHandles.includes(creator.toLowerCase())) {
core.setFailed("User not authorized to deploy")
}
- name: Trigger build
uses: benc-uk/workflow-dispatch@v1
with:
repo: ${{ secrets.GITHUBINDIA_REPO_NWO }}
workflow: Trigger build when public PR is merged
token: ${{ secrets.PAT }}
inputs: '{"pr_number": "${{ github.event.issue.number }}", "creator_username": "${{ github.event.issue.user.login }}" }'

0 comments on commit cde7f50

Please sign in to comment.