Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conform Action fails on PR with: failed to get commit message: object not found #231

Open
janderssonse opened this issue Oct 23, 2022 · 2 comments

Comments

@janderssonse
Copy link
Contributor

When running a dco check on a PR, conform enforce fails with "failed to get commit message: object not found".

How to trigger:

  1. 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 
  1. 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]
  1. 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

@Mallear
Copy link

Mallear commented Feb 2, 2023

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.

@janderssonse
Copy link
Contributor Author

It did, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants