getsentry / action-release

GitHub Action for creating a release on Sentry
Apache License 2.0
446 stars 53 forks source link

No commits found. Change commits range, initial depth or use --ignore-empty to allow empty patch sets. #136

Open garrettg123 opened 1 year ago

garrettg123 commented 1 year ago

Github Sentry Action Release Bug Report

Environment

How do you use this action? standard

Which version of the action? v1

Steps to Reproduce

    steps:
      - 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: myorg
          SENTRY_PROJECT: myproj
          # SENTRY_URL: https://sentry.io/
        with:
          environment: production

Expected Result

Sentry release success

Actual Result

No commits found. Change commits range, initial depth or use --ignore-empty to allow empty patch sets.

bifot commented 1 year ago

same for me

aldy505 commented 1 year ago

Also encountering this while using actions/checkout@v3 with and withoutfetch-depth: 0,

laygir commented 1 year ago

is there way to enable debug logs for this action, couldn't find it in the docs.

petrvecera commented 1 year ago

Anyone solved this? Running into the same issue with pretty standard workflow:

Error: Command failed: /action-release/dist/sentry-cli releases set-commits sentry-release --auto
error: No commits found. Change commits range, initial depth or use --ignore-empty to allow empty patch sets.

Sometimes it passses/ sometime it fails. I am getting pretty annoyed by "releases" in sentry.

Errors are amazing in sentry, everything works just like that out of the box. But these releases man, I am couple of hours already in and still doesn't work as I would like. Bad experience.

laygir commented 1 year ago

This action didn't work for me properly and I switched over to using sentry-cli directly.

# createSentryRelease.sh

# Retrieve package version and name from package.json
VERSION=$(node -p "require('./package.json').version")
PROJECT_NAME=$(node -p "require('./package.json').name")

printf "Will use $PROJECT_NAME@$VERSION\n"

# Replace with your organization slug
ORGANIZATION_SLUG="xxx"
# Accept environment as an argument with fallback to 'development'
ENVIRONMENT="${1:-development}"

# Create a new release with package name
RELEASE_NAME="$PROJECT_NAME@$VERSION"

# Create a new release
sentry-cli releases new "$RELEASE_NAME" --project "$PROJECT_NAME" --org "$ORGANIZATION_SLUG"

# Associate commits with the release, ignoring missing commits
sentry-cli releases set-commits "$RELEASE_NAME" --auto --ignore-missing --org "$ORGANIZATION_SLUG"

# Finalize the release
sentry-cli releases finalize "$RELEASE_NAME" --org "$ORGANIZATION_SLUG"

# Associate deployment with the release
sentry-cli releases deploys "$RELEASE_NAME" new -e "$ENVIRONMENT" --org "$ORGANIZATION_SLUG"

Then in my Github Actions, there is a step

- name: Create Sentry release
  env:
    SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
  run: |
    npm install -g @sentry/cli@2.18.1
    sentry-cli login --auth-token $SENTRY_AUTH_TOKEN
    chmod +x createSentryRelease.sh
    ./createSentryRelease.sh $ENV
SpencerKaiser commented 1 year ago

Solution

For those still struggling with this, the solution is super simple but obscure:

  1. Sentry > Settings > Integrations > GitHub

    image
  2. Configurations tab: create a configuration if your org isn't listed

  3. Add the repository you are creating your release from

    image
  4. Re-run your job and it should succeed

Credit to https://github.com/getsentry/action-release/issues/75#issuecomment-1083730665 and https://github.com/getsentry/action-release/issues/75#issuecomment-1229146323

laygir commented 1 year ago

I believe Github integration is a paid plan feature, so if you are on a free plan above solution might not work for you.

shaunsaker commented 1 year ago

Thanks @SpencerKaiser, worked for me 👍 FYI for anyone reading this, I'm on the free plan and was able to integrate with my Github repo.

sebastianbuechler commented 10 months ago

Solution

For those still struggling with this, the solution is super simple but obscure:

  1. Sentry > Settings > Integrations > GitHub
image
  1. Configurations tab: create a configuration if your org isn't listed
  2. Add the repository you are creating your release from
image
  1. Re-run your job and it should succeed

Credit to #75 (comment) and #75 (comment)

Thank you @SpencerKaiser, your solution also worked for me.