When using JIRA make sure to set
actions/[email protected] to pull from the pull_request HEAD. Github uses a single merge commit by default which is not referenced in git. This will cause commitsar JIRA check to fail as this commit will not be found by the API getting queried for PR by commit.
actions/[email protected] please set
fetch_depth to 0. Currently commitsar needs full git objects to work correctly. This will be fixed in an upcoming release.
A minimal example:
This will run
commitsar on every pull request and validate the commits for it.
This is a faster method since you don't have to build the Docker image in your Github action. If you need maximum security provided by Github actions please the Github Action Flow.
This pipeline example uses the checkout at PR HEAD. https://github.com/actions/checkout#Checkout-pull-request-HEAD-commit-instead-of-merge-commit