Last active
April 2, 2021 06:03
-
-
Save hamelsmu/4d671aae3d51f972f56e40da9c677f69 to your computer and use it in GitHub Desktop.
What is the payload field for determining the draft status of a PR for GitHub Actions?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You might be wonedering what this means
if: (github.event.issue.pull_request != null) && contains(github.event.comment.body, '/preview')
In the backend, GitHub PRs are a special kind of issue. So you might want to trigger something to happen when you comment on PRs, not Issues.
To make sure an
issue_comment
is actually a PR comment, you have to use this filtergithub.event.issue.pull_request != null
Finally, if you want to inspect a comment for the presence of a string, you can use the built-in function
contains
contains(github.event.comment.body, '/preview')
You can learn more about the built in functions here