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

commitsar fails on shallow clone #420

Open
vikas027 opened this issue Sep 16, 2021 · 1 comment
Open

commitsar fails on shallow clone #420

vikas027 opened this issue Sep 16, 2021 · 1 comment

Comments

@vikas027
Copy link

vikas027 commented Sep 16, 2021

Environmentent

I have downloaded commitsar executable on my custom action runner (running Ubuntu) and using it as below

    steps:
    - name: Checkout
      uses: actions/checkout@v2  # I have tried actions/checkout@v1 too

    - name: Validate Commits
      run: commitsar -v 

Problem

commitsar fails on a shallow clone

runner@runner-deployment-nzvgd-6kpsc:/runner/_work/.github/.github$ git log      
commit 048c926b55b5386bdc0cb4d0f0919a993afc46b3 (grafted, HEAD)
Author: Vikas Kumar <[email protected]>
Date:   Fri Sep 17 01:24:33 2021 +1000

    docs:  updated README
    
    Fixed the repository name in README
runner@runner-deployment-nzvgd-6kpsc:/runner/_work/.github/.github$

runner@runner-deployment-nzvgd-6kpsc:/runner/_work/.github/.github$ git branch -a
* (HEAD detached at 048c926)
runner@runner-deployment-nzvgd-6kpsc:/runner/_work/.github/.github$ 

runner@runner-deployment-nzvgd-6kpsc:/runner/_work/.github/.github$ commitsar -v
2021/09/16 15:56:51 config file not found, using defaults
   • Starting pipeline: commit-pipeline
   • Starting analysis of commits on branch HEAD
   • All pipelines complete   
   • [commit-pipeline] reference not found
Some errors were found
runner@runner-deployment-nzvgd-6kpsc:/runner/_work/.github/.github$ 

Workaround

    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

or

    - name: Validate Commits
      run: |
        git fetch --unshallow
        commitsar -v 
@fallion
Copy link
Member

fallion commented Sep 20, 2021

I’m going to see if we can use git instead to get data from a shallow clone. The current lib that is used fails on shallow objects :(

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