conform
conform copied to clipboard
Conform Action fails on PR with: failed to get commit message: object not found
When running a dco check on a PR, conform enforce fails with "failed to get commit message: object not found".
How to trigger:
- Create a sample project on github. In that, include a .conform,yaml ensuring dco: true is set under policies etc.
policies:
- type: commit
spec:
dco: true
- Using the sidero confirm GitHub action, do a commit to main branch (with dco), see the pipeline succeeds and confirm gives success, A simple GitHub action example
name: Conform DCO (--Sign-off)
on: ...add on PR etc
jobs:
signoff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Conform Action
uses: siderolabs/[email protected]
- Now, do a git checkout -b feat/my-feat, commit a valid commit. If running local conform enforce, it will succed. Then push to a new branch git push -u origin feat/my-feat etc., and make sure conform was run (on push or whatever you did set it to trigger on). Fails. Merge to main and conform will succed again (on the main branch).
So, it fails on PR to main with: failed to get commit message: object not found
Hello @janderssonse I have setup this action today and ran into this issue. I think this is due to the v3 of the checkout action which does fetched only one commit (see their Readme).
I've managed to get Conform action working by setting this:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Conform action
uses: siderolabs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
Hope it helps.
It did, thanks!