-
My workflow is triggered by both push and pull_request events. Merging changes from a pull request fires a push event, which means the workflow runs again for a merge commit. This seems redundant. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
When a push is from the merge of a PR, after the PR merged, on the target branch, it will automatically generate a head commit with the commit message looks like as " Merge pull request #<PR_ID> from <source_branch>". You can use the property github.event.head_commit of github context to access the head_commit object. And you also can use the property github.event.head_commit.message to view the message of the head commit. So you can try using the if conditional like as below to skip executing all the jobs in your workflow.
|
Beta Was this translation helpful? Give feedback.
-
Thanks. I did it without toJSON and with ! instead of == false. |
Beta Was this translation helpful? Give feedback.
When a push is from the merge of a PR, after the PR merged, on the target branch, it will automatically generate a head commit with the commit message looks like as " Merge pull request #<PR_ID> from <source_branch>".
You can use the property github.event.head_commit of github context to access the head_commit object. And you also can use the property github.event.head_commit.message to view the message of the head commit.
So you can try using the if conditional like as below to skip executing all the jobs in your workflow.