action-release icon indicating copy to clipboard operation
action-release copied to clipboard

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

Open garrettg123 opened this issue 2 years ago • 9 comments

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.

garrettg123 avatar Mar 30 '23 20:03 garrettg123

same for me

bifot avatar Apr 13 '23 12:04 bifot

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

aldy505 avatar May 22 '23 07:05 aldy505

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

laygir avatar May 26 '23 08:05 laygir

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.

petrvecera avatar May 31 '23 14:05 petrvecera

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/[email protected]
    sentry-cli login --auth-token $SENTRY_AUTH_TOKEN
    chmod +x createSentryRelease.sh
    ./createSentryRelease.sh $ENV
  • I have the env the pipeline is running for stored in $ENV

laygir avatar May 31 '23 16:05 laygir

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

SpencerKaiser avatar Jun 04 '23 06:06 SpencerKaiser

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

laygir avatar Jun 05 '23 09:06 laygir

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.

shaunsaker avatar Jul 07 '23 05:07 shaunsaker

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 #75 (comment) and #75 (comment)

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

sebastianbuechler avatar Jan 09 '24 13:01 sebastianbuechler