ggshield icon indicating copy to clipboard operation
ggshield copied to clipboard

Bug: scan first commit in GitHub action fails

Open GG-HH opened this issue 3 years ago • 0 comments

GitGuardian Shield Version

  • [x] I can reproduce this bug in the latest version (bug occured with gg-shield-action@master)

Command executed

I use the GitGuardian/gg-shield-action@master in my GitHub CI.

Describe the bug

When pushing the first commit of a repo, the action fails.

Expected behavior

I expect this commit to be scanned and the action to finish.

Traceback (if available)

Error: Unable to get commit range. Please submit an issue with the following info:
  Repository URL: <Fill if public>
github_push_before_sha: 0000000000000000000000000000000000000000
github_push_base_sha: 
github_pull_base_sha: github_default_branch: main
github_head_sha: REDACTED

** Action configuration**

 ggshield:
    name: Check for secrets with ggshield
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0 # fetch all history so multiple commits can be scanned

      - name: GitGuardian scan
        uses: GitGuardian/gg-shield-action@master
        env:
          GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
          GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
          GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
          GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
          GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}

GG-HH avatar Jul 26 '22 14:07 GG-HH