Skip to content

Informing sentry about the latest release tag #122

Open
@altjx

Description

@altjx

According to the documentation, it appears that it's possible to include the release tag when informing Sentry, but only if the PR is triggered via a release, is that correct?

In my case, I am creating a PR by another GitHub Workflow (not a release), and so I'm trying to determine a workaround with informing Sentry about the latest release tag version.

Here's what I have thus far:

  inform_sentry_about_release:
    runs-on: ubuntu-latest
    env:
      ACCESS_TOKEN: ${{ secrets.GH_PAT }}
    steps:
      - uses: actions/checkout@v2
      - name: Set GITHUB_VERSION variable
        run: |
          echo 'GITHUB_LATEST_RELEASE=$(curl -H "Authorization: token ${ACCESS_TOKEN}" "https://api.github.com/repos/myusername/myreponame/releases" -s | jq -r ".[0].tag_name")' >> $GITHUB_ENV
      - 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
          version: ${{ GITHUB_LATEST_RELEASE }}

The problem is that the workflow fails here:

The workflow is not valid. .github/workflows/production-label.yml (Line: 131, Col: 20): Unrecognized named-value: 'GITHUB_LATEST_RELEASE'. Located at position 1 within expression: GITHUB_LATEST_RELEASE

which is referring to this:

version: ${{ GITHUB_LATEST_RELEASE }}

Is there a way to simply inform Sentry about the latest release tag without having to do all of this, or at least a way to utilize an environment variable that should be set from the previous step?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions