feat: allow the use of if condition to trigger github events#357
Open
toVersus wants to merge 1 commit intorhysd:mainfrom
Open
feat: allow the use of if condition to trigger github events#357toVersus wants to merge 1 commit intorhysd:mainfrom
toVersus wants to merge 1 commit intorhysd:mainfrom
Conversation
a7a1624 to
c83ac9f
Compare
Owner
|
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
Author
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' |
Owner
|
Okay, I'll ask it at the official forum. |
78e9286 to
0b49da7
Compare
05e056b to
5aaa4ce
Compare
1327bf4 to
859504b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.