action-release: Could not find the SHA of the previous release
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!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 16
Commits related to this issue
- feat(ci): Try to fix Sentry releases It is a bit fuzzy, but this might fix our Sentry releases always including the last 20 commits because it cannot find the previous release? https://github.com/get... — committed to getsentry/eng-pipes by billyvg 3 years ago
- feat(ci): Try to fix Sentry releases (#260) It is a bit fuzzy, but this might fix our Sentry releases always including the last 20 commits because it cannot find the previous release? https://github.... — committed to getsentry/eng-pipes by billyvg 3 years ago
Hi, I am getting the same error even after adding
fetch-depth: 0at the new repository. Any solution?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-missingflag to the parameters of the action.In case anyone else is experiencing this still, our team found it was due to using git rebase.
@NisanthanNanthakumar could you add the
ignore-missingflag?Can confirm
fetch-depth: 0is no longer resolvingerror: Could not find the SHA of the previous release in the git history. Increase your git clone depth.Actually my issue was I didn’t have the Sentry <-> GitHub integration configured correctly