question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find the SHA of the previous release

See original GitHub issue

When I used the following:

sentry_release:
  name: Create Sentry release
  needs: [ test_js, test_py ]
  runs-on: ubuntu-latest
  if: github.ref == 'refs/heads/master'
  steps:
    - uses: actions/checkout@v2
    - name: Create Sentry release
      uses: getsentry/action-release@v1
      env:
        SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
        SENTRY_ORG: ${{ env.ORG }}
        SENTRY_PROJECT: ${{ env.SENTRY_PROJECT }}
      with:
        environment: prod

I got the following error:

error: Could not find the SHA of the previous release in the git history. Increase your git clone depth.

It wasn’t clear obvious what to do right away, so I’m wondering if, in the documentation/README, it would be better to change the checkout step to following and add a note about why it’s necessary.

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

This is what solved it for me. I also wasn’t sure if I should use something other than zero because in Github’s docs it’s not clear what other numbers do.

I’m happy to make a PR for the README if this sounds good or please go ahead and just change it if you want.

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Fredx87commented, Jun 25, 2021

I have the same issue, I created a release from a feature branch, then squashed the commits, and then the merge to master created a new release. The release creation on master fails with Could not find the SHA of the previous release in the git history..

This case is mentioned in the documentation: https://docs.sentry.io/product/cli/releases/#dealing-with-missing-commits. Probably it would be nice to add the ignore-missing flag to the parameters of the action.

3reactions
mhihasancommented, Mar 30, 2021

Hi, I am getting the same error even after adding fetch-depth: 0 at the new repository. Any solution?

- uses: actions/checkout@v2
  with:
    fetch-depth: 0
- name: Create Sentry release
  uses: getsentry/action-release@v1
  env:
    SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
    SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
    SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
  with:
    environment: production
Read more comments on GitHub >

github_iconTop Results From Across the Web

Couldn't not find the SHA of the previous release in the git ...
Hey everybody, I'm using Sentry on a repository where we have several branches that upload source maps to Sentry, each time with a...
Read more >
Sentry.io ~ All commits associated to all releases
I am getting the Releases tab populated, with releases that correspond to the sha of the commit that triggers each deployment… This is,...
Read more >
git - How can I get the SHA number of previous commit?
The command to translate any specifier into a hash ID is git rev-parse . The syntax that means "find the parent commit of...
Read more >
2019 SHA-2 Code Signing Support requirement for Windows ...
Any devices without SHA-2 support will not be able to install Windows updates on or after July 2019. To help prepare you for...
Read more >
Docker Desktop release notes
For frequently asked questions about Docker Desktop releases, see FAQs ... By default Docker will not create the /var/run/docker.sock symlink on the host ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found