Next.js Discord

Discord Forum

Requiring Approval For CI/CD Deployments in PR

Answered
"use php" posted this in #help-forum
Open in Discord
I've a private repo and I want it such that if someone creates a PR,
I want it to require my approval to run a workflow.

there is a feature in Github, but it requires enterprise: https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment#required-reviewers


What do you suggest I should do
Answered by "use php"
The only way I was able to solve it was, listen for issue_comments
on:
  issue_comment:  
    types: [created]


Then, verify that I created it:
jobs:
  publish:
    if:  | 
      github.event.issue.pull_request && contains(github.event.comment.body, '/preview') && github.event.comment.user.login == 'anay-208' ||


And proceed to build the app.
View full answer

1 Reply

The only way I was able to solve it was, listen for issue_comments
on:
  issue_comment:  
    types: [created]


Then, verify that I created it:
jobs:
  publish:
    if:  | 
      github.event.issue.pull_request && contains(github.event.comment.body, '/preview') && github.event.comment.user.login == 'anay-208' ||


And proceed to build the app.
Answer