-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow the use of if condition to trigger github events #357
base: main
Are you sure you want to change the base?
Conversation
a7a1624
to
c83ac9f
Compare
I couldn't find documentation for this syntax in any official documents:
Would you show some pointer? I'd like to confirm this is officially defined by GitHub. |
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
c83ac9f
to
18988e5
Compare
Unfortunately, I couldn't find the documentation either, so I demonstrated the behavior using the sample repository. name: Terraform Digger
on:
pull_request:
branches: [ "main" ]
types: [ closed, opened, synchronize, reopened ]
issue_comment:
types: [created]
if: contains(github.event.comment.body, 'digger')
workflow_dispatch:
jobs:
(...) I understand that this request may not be considered acceptable since it's not documented behavior. In that case, we will proceed by continuing to ignore the specifi linter error using the following command. actionlint -color -ignore 'unexpected key "if" for "issue_comment" section' |
Okay, I'll ask it at the official forum. |
78e9286
to
0b49da7
Compare
05e056b
to
5aaa4ce
Compare
We could add if condition to trigger workflows with all the supported GitHub events. Please refer to the example repository below.
https://github.com/toVersus/github-actions-sandbox
However, when running actionlint on the example repository, it will return the following error:
This PR enables the linter to permit the use of if condition for triggering GitHub events.