Skip to content

Running Github Actions on PRs After Explicit Approval #25100

Answered by oldskool
bkabrda asked this question in Actions
Discussion options

You must be logged in to vote

You should just be able to attach a workflow to the issue_comment event type (pull requests are internally/by the API also seen as a type of issue object):

on:
  issue_comment:
    types: [created]

Then in your steps, you can do some verification on the comment content and check wheter you are the author. Although the latter probably has no 100% fool-proof way to be verified, depending on your use-case it may be sufficient to do it like that. So, something like (untested pseudo-code):

steps:
  - name: run-something
    if: github.event.issue.comment.body == "Github, OK to test" && github.event.issue.comment.author == "bkabrda"
    run: <do your stuff here>

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants