Workflow passes despite pattern not being present in the PRs commits.
repro steps:
1) create multiple commits, have the matching pattern in one of these commits.
2) open PR, workflow passes as expected.
2) amend the message to remove the pattern. Now no commits in the PR have the pattern force push. Expect workflow to fail
3) workflow still passes despite no commits in the PR having a the matching pattern
This is my action definition:
name: Jira Message Check
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Check Commit Message For Jira Tag
uses: gsactions/commit-message-checker@v1
with:
pattern: 'JIRA: (KAT\-[0-9]+|NOJIRA)$'
error: 'You need at least one "JIRA: KAT-<issue number>" line below the title line. If there is no jira associated with this PR/commit you may also use JIRA: NOJIRA. Please see docs/contributing/git-style.rst#submitting-changes for examples'
excludeTitle: 'true'
excludeDescription: 'true'
Could the previous commit messages be still cached somewhere in the workflow, and end up getting passed to the check-commit-message workflow?
a data point to support this theory: if I add checkAllCommitMessages: 'true' to my workflow, it fails as expected since none of the commits contain the pattern.
If I then switch back to the default checkAllCommitMessages: 'false' it incorrectly passes.
Workflow passes despite pattern not being present in the PRs commits.
repro steps: 1) create multiple commits, have the matching pattern in one of these commits. 2) open PR, workflow passes as expected. 2) amend the message to remove the pattern. Now no commits in the PR have the pattern force push. Expect workflow to fail 3) workflow still passes despite no commits in the PR having a the matching pattern
This is my action definition:
Could the previous commit messages be still cached somewhere in the workflow, and end up getting passed to the
check-commit-message
workflow?a data point to support this theory: if I add
checkAllCommitMessages: 'true'
to my workflow, it fails as expected since none of the commits contain the pattern. If I then switch back to the defaultcheckAllCommitMessages: 'false'
it incorrectly passes.