Giter Club home page Giter Club logo

action-release's People

Contributors

airgrim avatar armenzg avatar dependabot[bot] avatar dirkgroenen avatar jonesphillip avatar kamilogorek avatar leeandher avatar loewenheim avatar mattgauntseo-sentry avatar mgaeta avatar oogali avatar pbstriker38 avatar scefali avatar sue445 avatar tanyagray avatar tyree731 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-release's Issues

error: could not find repository from '.'; class=Repository (6); code=NotFound (-3)

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
TypeScript 4

Steps to Reproduce

name: Sentry release

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '14'
      - name: Install dependencies
        run: npm install
      - name: Get the version
        id: get_version
        run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
      - name: Create Sentry release
        uses: getsentry/action-release@v1
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: exampleorg
          SENTRY_PROJECT: myproject
        with:
          environment: production
          version: ${{ steps.get_version.outputs.VERSION }}

Expected Result

Release is created on sentry.

This snippet is working fine.

      - name: Create Sentry release
        run: |
          sentry-cli info 2>&1 || curl -sL https://sentry.io/get-cli/ | bash
          sentry-cli releases new "$VERSION"
          sentry-cli releases files "$VERSION" upload-sourcemaps dist
          rm dist/*.map
          sentry-cli releases finalize "$VERSION"
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: exampleorg
          SENTRY_PROJECT: myproject
          VERSION: ${{ steps.get_version.outputs.VERSION }}

Actual Result

Run getsentry/action-release@v1
/usr/bin/docker run --name sentryintegrationssentrygithubactionreleaselatest_e4dc8a --label c3f261 --workdir /github/workspace --rm -e SENTRY_AUTH_TOKEN -e SENTRY_ORG -e SENTRY_PROJECT -e INPUT_ENVIRONMENT -e INPUT_VERSION -e INPUT_SOURCEMAPS -e INPUT_FINALIZE -e INPUT_STARTED_AT -e INPUT_VERSION_PREFIX -e INPUT_SET_COMMITS -e INPUT_PROJECTS -e INPUT_URL_PREFIX -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/tmp/github-runner/_temp/_github_home":"/github/home" -v "/tmp/github-runner/_temp/_github_workflow":"/github/workflow" -v "/tmp/github-runner/_temp/_runner_file_commands":"/github/file_commands" -v "/tmp/github-runner/example.org/example.org":"/github/workspace" sentryintegrations/sentry-github-action-release:latest
Error: Command failed: /action-release/dist/sentry-cli releases set-commits master --auto
error: could not find repository from '.'; class=Repository (6); code=NotFound (-3)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

IO error for operation on ./www: No such file or directory (os error 2)

Environment

How do you use Sentry?
Self-hosted/on-premise / Version Sentry 21.8.0.dev0 0664dd8

Steps to Reproduce

  1. Create angular project.
  2. Build it (so that you have www folder)
  3. Try to use this step

Expected Result

Source maps are uploaded successful.

Actual Result

error: ./www: IO error for operation on ./www: No such file or directory (os error 2)

This is a preview of my action.

      - name: List files
        run: ls -al ./www
      - 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 }}
          SENTRY_URL: ${{ secrets.SENTRY_URL }}
        with:
          environment: dev
          sourcemaps: ./www
          set_commits: skip

The list is successful.

total 16840
drwxr-xr-x  4 root root   12288 Sep 13 20:59 .
drwxr-xr-x 12 root root    4096 Sep 13 20:59 ..
-rw-r--r--  1 root root     461 Sep 13 20:59 1006.73dc42eae00d4b7873dd.js
-rw-r--r--  1 root root    1116 Sep 13 20:59 1006.73dc42eae00d4b7873dd.js.map
-rw-r--r--  1 root root   15050 Sep 13 20:59 123.f318719ca66193f8dc29.js
-rw-r--r--  1 root root   24887 Sep 13 20:59 123.f318719ca66193f8dc29.js.map
-rw-r--r--  1 root root    2022 Sep 13 20:59 1535.ed490ee0f20f85053cf6.js
-rw-r--r--  1 root root    8107 Sep 13 20:59 1535.ed490ee0f20f85053cf6.js.map
-rw-r--r--  1 root root   76692 Sep 13 20:59 2099.c7e6f2de2efc6764b1eb.js
-rw-r--r--  1 root root   94027 Sep 13 20:59 2099.c7e6f2de2efc6764b1eb.js.map
-rw-r--r--  1 root root    1324 Sep 13 20:59 2177.df02d406d5e9573ad358.js
-rw-r--r--  1 root root    6152 Sep 13 20:59 2177.df02d406d5e9573ad358.js.map
-rw-r--r--  1 root root    6036 Sep 13 20:59 2178.80f553e271e82f3f52d6.js
-rw-r--r--  1 root root   14983 Sep 13 20:59 2178.80f553e271e82f3f52d6.js.map

So I have many source map files.

Then this action has an error.

error: ./www: IO error for operation on ./www: No such file or directory (os error 2)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

When I do the same on local CLI by myself it work's fine.

$ sentry-cli releases files 1.0.0 upload-sourcemaps ./www
> Found 141 release files
> Analyzing 141 sources
> Analyzing completed in 0.278s
> Rewriting sources
> Rewriting completed in 0.322s
> Adding source map references
> Bundling files for upload... ~/4806.b179e5a749e25a15c565.js
> Bundling completed in 0.376s
> Optimizing completed in 0.009s
> Uploading completed in 0.803s
> Uploaded release files to Sentry
> Processing completed in 0.05s
> File upload complete (processing pending on server)

Command failed: /action-release/dist/sentry-cli releases set-commits 2.5 --auto

I am using Sentry Saas
This error comes from the github action

I have setup the action as follows:

      - 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: $ENVIRONMENT
          sourcemaps: ./build
          version: ${{ env.REACT_APP_BUILD_NUMBER }}
          set_commits: auto

I then get the error:
Command failed: /action-release/dist/sentry-cli releases set-commits 2.5 --auto

2.5 is the value of REACT_APP_BUILD_NUMBER in this run,

error: API request failed (http status: 403)

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
N/A

Steps to Reproduce

  1. I added code below in my workflow and wanted to upload my source maps to Sentry:
 - name: Sentry Release
        uses: getsentry/[email protected]
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: HIDDEN
          SENTRY_PROJECT: HIDDEN
        with:
          environment: prod
          sourcemaps: dist
          set_commits: skip

And below are my permissions:
Screenshot 2021-04-07 at 0 25 53

Expected Result

Successfully create a new release to Sentry and upload the source maps.

Actual Result

Screenshot 2021-04-07 at 0 19 05

Pass URL to sentry-cli

Pass URL to sentry-cli using the action, to support on-premise instances of Sentry.
The Sentry cli is supporting the option.

$ sentry-cli --help
sentry-cli 1.70.1

Command line utility for Sentry.

This tool helps you manage remote resources on a Sentry server like
sourcemaps, debug symbols or releases.  Use `--help` on the subcommands
to learn more about them.

USAGE:
    sentry-cli <SUBCOMMAND>

OPTIONS:
......
        --url <URL>
            Fully qualified URL to the Sentry server.
            [defaults to https://sentry.io/]
......

Connecting to on-premise

It's unclear to me if it is possible to connect this workflow to a on-premise version of Sentry or not.
If so, how/where do I declare the URL?
Thanks!

Ability to add multiple environments

Currently, It's possible to optionally add a single environment.

- uses: actions/checkout@v2
- name: Create Sentry release
  uses: getsentry/action-release@v1
  env:
     . . .
  with:
    environment: production  #<<<

It would be great to be able to add multiple environments for example:

  with:
    environments: [production, staging]

Or:

  with:
    environments:
     - production
     - staging
     - ...

The only way to achieve this kind of behavior now is to have it all twice, which is a pain. Especially if you want to be specific.

More examples

I think it would be great to show more samples of how to transition from the cli usage over to the action usage.

Especially the use case where you open a release and finalize it.

        run: |
          export SENTRY_RELEASE=$(sentry-cli releases propose-version)
          sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
          sentry-cli releases set-commits --auto $SENTRY_RELEASE
          echo "::set-env name=SENTRY_RELEASE::$SENTRY_RELEASE"

and

      - name: Sentry deploy
        run: |
          sentry-cli releases finalize $SENTRY_RELEASE
          sentry-cli releases deploys $SENTRY_RELEASE new -e $SENTRY_DEPLOY_ENVIRONMENT

Automatic version does not work if repo is checked out to a path other than Workspace

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
getsentry/[email protected]

Steps to Reproduce

  1. Create a GitHub Actions workflow that checks out repository to non-default path:2.
steps:
  - uses: actions/checkout@v3
     name: ๐Ÿ”ฌ - Checkout EMG API
     with:
       repository: 'someuser/somerepo'
       ref: 'abranch'
       path: 'a-subdir'

  - name: Sentry Release
     uses: getsentry/[email protected]
     env:
       SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
       SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
       SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
     with:
       environment: 'an-env'
       sourcemaps: './a-subdir/dist/js'

Expected Result

The version should be taken from the commit SHA.

Actual Result

The action step fails:

Error: Command failed: /action-release/dist/sentry-cli releases propose-version
[28](https://github.com/<someuser>/<somerepo>/runs/<runid>?check_suite_focus=true#step:21:28)
error: Could not automatically determine release name

This is because the action does NOT use the GitHub SHA directly, but calls the CLI's proposeVersion, which seemingly needs to be run with the working-dir as the repository.

Partial fix, second failure

Add with: version: ${{ github.sha }} to the Sentry Release action.

Expected Result

The manual version label is then used and action should succeed.

Actual Result

Action step fails:

INFO    2022-04-12 08:27:21.419745496 +00:00 Resolving HEAD (<someuser>/<somerepo>@HEAD)
error: could not find repository from '.'; class=Repository (6); code=NotFound (-3)

Make 'environment' optional

I was hoping to use this to push new releases mainly for suspected commits.
Once I make a build, I'll be promoting the same artifacts throughout different environments (stg/prod).

The docs state the environment, why is that the case? And would it be possible to make it optional?

API request failed (http status: 503)

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
n/a

Steps to Reproduce

Used this GitHub action.

Expected Result

Release would be reported and my workflow would complete successfully.

Actual Result

My workflow failed with:

Error: Command failed: /action-release/dist/sentry-cli releases set-commits a5a6307641da6a013acad34cc4e277435d206489 --auto
error: API request failed
  caused by: sentry reported an error: unknown error (http status: 503)

Unexpected input 'url_prefix'

I'm trying to create a Sentry.io release using the Github action and keep running into the error below:

Warning: Unexpected input(s) 'url_prefix', valid inputs are ['entryPoint', 'args', 'environment', 'sourcemaps', 'finalize', 'started_at', 'version', 'version_prefix', 'set_commits', 'projects']
Run getsentry/action-release@v1
/usr/bin/docker run --name sentryintegrationssentrygithubactionreleaselatest_d37d34 --label 179394 --workdir /github/workspace --rm -e SENTRY_AUTH_TOKEN -e SENTRY_ORG -e SENTRY_PROJECT -e INPUT_ENVIRONMENT -e INPUT_SOURCEMAPS -e INPUT_URL_PREFIX -e INPUT_FINALIZE -e INPUT_STARTED_AT -e INPUT_VERSION -e INPUT_VERSION_PREFIX -e INPUT_SET_COMMITS -e INPUT_PROJECTS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/oneasics-portal/oneasics-portal":"/github/workspace" sentryintegrations/sentry-github-action-release:latest

The relevant part of my yaml file:

      - 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: 'dev2'
          set_commits: 'skip'
          sourcemaps: './build/static/js'
          url_prefix: '~/console/static/js'

Should I be using entryPoint instead of url_prefix?

Commits not found

Hi thanks for publishing this action, very handy! I'm getting the following error in one of my repositories (private).

usr/bin/docker run --name sentryintegrationssentrygithubactionreleaselatest_b8842c --label 87c201 --workdir /github/workspace --rm -e SENTRY_AUTH_TOKEN -e SENTRY_ORG -e SENTRY_PROJECT -e INPUT_ENVIRONMENT -e INPUT_SOURCEMAPS -e INPUT_VERSION -e INPUT_FINALIZE -e INPUT_STARTED_AT -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/redacted/redacted":"/github/workspace" sentryintegrations/sentry-github-action-release:latest
##[error]Command failed: /action-release/dist/sentry-cli releases set-commits 3.57.0 --auto
error: No commits found. Leaving release alone.

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

Here is the simplified yaml:

name: Tag release

on:
  push:
    branches: [master]
    tags:
      - '!v*'

jobs:
  tag_release:
    name: Tag release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Create Sentry release
         uses: getsentry/[email protected]
         env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: REDACTED
          SENTRY_PROJECT: REDACTED
        with:
          environment: production    
          sourcemaps: '${{ env.GITHUB_WORKSPACE }}/app'
          version: 3.57.0

version_prefix ignored when version provided

The getVersion() function prematurely returns when the version option is set.

So, something like this ignores the prefix option

- name: Create Sentry Release
  uses: getsentry/action-release@v1
  with:
    environment: prod
    version_prefix: app-name@
    version: ${{ env.IMAGE_TAG }}

New release checklist for v1.2.1

You can see the action released in here.

Checklist for a new release:

  • Create a PR that bumps the version in package.json and merge it
  • Once merged, visit the releases page
    • Create a new release
    • Name the release (You can use the version number if you want)
    • Describe the release by looking at what commits landed on master since the last release
    • Create a new tag by entering it in the drop down
      • If it's a security update, tag is a patch release
      • If it's just some improvements or bug fix, tag is a minor release
      • If there are breaking changes, tag it as a major release
        • Figure out if we need to do an external annoucement of sorts
  • Once published, visit the marketplace to see that the release is showing up

"Action not found" with @v1 tag

The documentation and examples all have this line in the workflow:

uses: getsentry/action-release@v1

Using this generates the following error for me every time:
An action could not be found at the URI 'https://api.github.com/repos/getsentry/action-release/tarball/v1'

Changing it to @master or @e36b15df9c918bb4f976e36893d08d35538daa59 (or some other specific commit) works, but I can't get it to work using the syntax from the documentation.

strip the prefix for github.ref (refs/heads)

I have a case that in the staging environment we are not using the tags but a release-candidate branch, so I'm expecting to have a release candidate branch name as the version.
I noticed that only the refs/tags/ is stripped, so when setting version with ${{ github.ref }} it complains the slashes are not permitted.

I'm wondering if we can enhance the following regex process to allow strip the prefix for refs/heads as well?

// If the users passes in `${{github.ref}}, then it will have an unwanted prefix.
version = versionOption.replace(/^(refs\/tags\/)/, '');

Could not find repository from '.'

I'm using semantic-release to create new tags/releases.

Semantic-Release uses the GITHUB_TOKEN to draft a new release, and according to GitHub, those actions do not trigger an event on GitHub Actions (such as on: release). The alternative is to trigger a workflow after semantic-release is done:

name: Sentry Release

on:
  workflow_run:
    workflows:
      - 'Semantic Release'
    branches:
      - main
    types:
      - completed

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/github-script@v3
        id: release
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const release = await github.repos.getLatestRelease({
              owner: context.repo.owner,
              repo: context.repo.repo
            });
            return release.name;
          result-encoding: string
      - name: Create Sentry release
        uses: getsentry/[email protected]
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
          SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
          SENTRY_LOG_LEVEL: debug
        with:
          environment: production
          version: ${{steps.release.outputs.result}}

There are two issues

warning

Unexpected input(s) 'version', valid inputs are ['entryPoint', 'args', 'environment', 'sourcemaps', 'finalize', 'started_at']

Version is a parameter according to the readme.

failure

Second, something is wrong with the repositories:

DEBUG   2020-09-28 21:15:33.868807990 +00:00 < Link: <https://sentry.io/api/0/organizations/***/repos/?&cursor=100:-1:1>; rel="previous"; results="false"; cursor="100:-1:1", <https://sentry.io/api/0/organizations/***/repos/?&cursor=100:1:0>; rel="next"; results="false"; cursor="100:1:0"
...
DEBUG   2020-09-28 21:15:33.868871489 +00:00 response status: 200
DEBUG   2020-09-28 21:15:33.869251286 +00:00 body: [{
	"status": "active",
	"integrationId": "",
	"externalSlug": "***/api",
	"name": "***/api",
	"provider": {
		"id": "integrations:github",
		"name": "GitHub"
	},
	"url": "https://github.com/***/api"
}, {
	"status": "active",
	"integrationId": "",
	"externalSlug": "***/***",
	"name": "***/***",
	"provider": {
		"id": "integrations:github",
		"name": "GitHub"
	},
	"url": "https://github.com/***/***"
}]
INFO    2020-09-28 21:15:33.869439585 +00:00 Resolving HEAD (***/api@HEAD)
DEBUG   2020-09-28 21:15:33.869525384 +00:00 error: running update nagger
DEBUG   2020-09-28 21:15:33.869536184 +00:00 skipping update nagger because session is not attended
error: could not find repository from '.'; class=Repository (6); code=NotFound (-3)

The first thing that I see is that the repo is wrong (Resolving HEAD (***/api@HEAD), while the repo name is web) and then obviously error: could not find repository from '.'.

Not exactly sure what's going on? The secrets are all correct and I checked the requests in curl, the results are correct too.

Use @sentry/cli v2

It would be great to be able to use the latest version of @sentry/cli !

Windows support

Any chance it could be made to work on windows? We build our software on a self hosted windows instance, so it doesn't make sense to spin up a linux instance just to call a web api.

image

`set-output` command deprecation

Hi.

As per https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/, the set-command output has been deprecated, which results in the following warning being issued whenever the action is used:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

The warning should go away by bumping @actions/core package to 1.10.0 or higher.

Action fails with ARM architecture

Environment

  1. Self-hosted Github Runner on ARM64 architecture

Steps to Reproduce

  1. Add the action to workflow

Expected Result

  1. Workflow executes successfully

Actual Result

image

V2 Release - Upgrade sentry-cli

Update to the latest sentry-cli version:

Latest 2.x
Current 1.67.2 (Released almost three years ago)

  • Support different Docker images (task to be created separately)
  • Create a v2 branch
  • Upload v2 Docker images
  • Upgrade sentry-cli to v2
  • Follow the release checklist (issue template) and create a v2 pre-release
  • Start dogfooding
  • Release it to the world
  • Create a v1 branch
  • Merge the v2 branch

Add a CHANGELOG for the action

We should add some kind of CHANGELOG. Makes it easier for users of the action to understand what fixes/features have happened. Also provides us a way to introduce + document breaking changes.

Sentry project accepts multiple args

I have a workflow on github actions that publishes several modules from a repository
(monorepo)

it would be interesting if I could release the multiple modules (which are projects in sentry) in one step
via SENTRY_PROJECTaccepting multiple args

something like this

  - name: Create Sentry release
    uses: getsentry/action-release@v1
    env:
      SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
      SENTRY_PROJECT: orodruin-worker orodruin-server
    with:
      environment: production
      version: ${{ needs.changelog.outputs.ref }}

can not get any sourcemap files when i had set sourcemaps

below is my action

 - name: Send Release To Sentry
    uses: getsentry/action-release@v1
    env:
      SENTRY_AUTH_TOKEN: "xxx"
      SENTRY_ORG: "xxx"
      SENTRY_PROJECT: "xxx"
      SENTRY_URL: "xxx"
    with:
      environment: "production"
      sourcemaps: "./dist/assets"
      version: ${{ github.sha }}
      set_commits: "skip"
      url_prefix: "~/sentry-config-test/assets"

Expected Result

i hope i can upload sourcemap successful!!!

Actual Result

image

Parameter naming confusing

The version parameter of this action is actually the release field in the Sentry init config. This naming mismatch is confusing and particularly interesting since https://docs.sentry.io/platforms/javascript/#configure suggests prefixing your releases with a projectname. If the names are inconsistent, the releases will not work properly and debugging is kind of hard due to the behavior of releases in Sentry (shown below). The appropriate naming is non-obvious from the documentation and slightly weird for a version parameter.

The releases tab seems to auto-generate releases for incoming errors, so it will show both versions making it appear the correct one was created.
image
However diving into a project's source maps (that page is kind of hidden) will show the versions twice, one without source maps (as also apparent in errors if your server is blocking HTTP access to sourcemaps):
image
Only the tooltip will reveal the true release name (the other has no prefix):
image

I would suggest adding a release or release-name parameter and deprecating version or hiding it in the docs for clarity.

[Meta] No CI Workflow for Lint/Test

So I forked the project yesterday to add some missing parameters and I ran yarn run all to make sure my cloned copy before starting was passing tests, etc.

The command failed.

โžœ  action-release git:(master) yarn run all 
yarn run v1.22.17
$ yarn run format && yarn run lint && yarn run build && yarn test
$ prettier --write **/*.ts
__tests__/main.test.ts 130ms
src/cli.ts 14ms
src/main.ts 10ms
src/options.ts 18ms
$ eslint src/**/*.ts

/Volumes/Nexus/Github/action-release/src/cli.ts
  1:20  error  'SentryCliReleases' is defined but never used  @typescript-eslint/no-unused-vars

โœ– 1 problem (1 error, 0 warnings)

So then I wondered how PRs were getting merged. They don't seem to be running lints or tests at all. The test workflow just runs the action itself in MOCK mode. Was it an oversight that no CI workflow actually runs and enforces Linting/Testing?

Unexpected input(s) 'version_prefix'

Environment

How do you use Sentry?

Sentry SaaS (sentry.io)

Which SDK and version?

gem "sentry-rails", "4.3.2"
gem "sentry-ruby", "4.3.1"

Steps to Reproduce

  1. Set up Sentry Release GitHub Action with this:
name: Build

on:
  push:
    branches: [main]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the latest code
        uses: actions/checkout@v2
      - name: Notify Sentry of Build
        uses: getsentry/[email protected]
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: nulogy
          SENTRY_PROJECT: opscore
        with:
          version_prefix: opscore@
  1. Trigger GitHub Action by pushing to main

Expected Result

No warnings

Actual Result

Warning message in the GitHub Action: image

The version prefix seems to be getting through though because I see it in the Releases page in Sentry:
image

set_commits: use (commit) range based on previous release/deployment of given env

It would be useful if commits could be set based on the previous release for the given environment, instead of the latest release.

That would allow to have granular / more correct assignments of commits for a testing/staging/production workflow, where releases to testing (e.g. deployed when merging into the master/main branch) would have a small number of commits, whereas the set of commits for a (pre-)release to staging then is bigger (but includes all the ones from testing being released to staging only now), and production typically has the same set of commits as the release to staging then.

Currently it appears to be that the creation of the release for testing assigns a small set of commits to the release, and then the same set (typically only one from a merged PR) is used for the later release to staging/production.

I've only found out just now that environment is optional with the GitHub Action (#19, #36), and will trigger a deployment, which might have interfered with / caused the behavior I am seeing/describing above. So I'll test it without specifying the environment, but suspect the issue might persist, given the docs that say:

If you also want to set a previous commit instead of letting the server use the previous release as the base point you can do that by setting a commit range

(Assuming that a new set_commits: prev_env setting might make sense, I'd probably still like not having created a deployment automatically if environment is provided, so this would maybe have to be controlled through a separate setting then)

Landing code on master should not produce a new image

Currently, almost any code landing on master will produce a new Docker image tagged as latest which all users of the action will immediately start using.

We need to have control as to when releases happen.

We should only release on tag changes as suggested by @asottile-sentry

As you can see, the commits below are not code changing, thus, it should not produce a new image

image

image

As a side note, to my surprise, the caching gets invalidated with COPY package.json yarn.lock /action-release :
https://github.com/getsentry/action-release/runs/7567494647?check_suite_focus=true#step:4:51
Before, we used to copy it from the builder image.

Environment variable SENTRY_AUTH_TOKEN is missing an auth token

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
React 6.2.1

Steps to Reproduce

  1. Opened a PR that automatically ran the github action.
  2. The action tried to push to sentry, but failed due to a missing token error.

Expected Result

The build was pushed to the sentry site.

Actual Result

I'm not sure if this is the right place to report this, or if this is just a general actions bug. When the action ran, it produced the following error:
Environment variable SENTRY_AUTH_TOKEN is missing an auth token

I checked, double-checked, and triple-checked, and the token is definitely set. The check even passes and fails at random, with the same error, and no changes to the environment. Rerunning the check seems to make it pass, but not always.

The relevant portion of the logs is:

2021-03-10T16:42:09.1911230Z ##[group]Run getsentry/[email protected]
2021-03-15T07:16:43.4645475Z with:
2021-03-15T07:16:43.4645881Z   environment: deploy-preview
2021-03-15T07:16:43.4646317Z   sourcemaps: ./build/
2021-03-15T07:16:43.4646907Z   version: 83e3c0f96eed086fd37d86a7dc6accf9caf88e9c
2021-03-15T07:16:43.4647539Z   version_prefix: forms-frontend@
2021-03-15T07:16:43.4647961Z   finalize: true
2021-03-15T07:16:43.4648263Z env:
2021-03-15T07:16:43.4648584Z   SENTRY_AUTH_TOKEN: 
2021-03-15T07:16:43.4648977Z   SENTRY_ORG: python-discord
2021-03-15T07:16:43.4649444Z   SENTRY_PROJECT: forms-frontend
2021-03-10T16:42:09.1915408Z ##[endgroup]
2021-03-10T16:42:09.1950772Z ##[command]/usr/bin/docker run --name sentryintegrationssentrygithubactionreleaselatest_3c90fc --label 5588e4 --workdir /github/workspace --rm -e SENTRY_AUTH_TOKEN -e SENTRY_ORG -e SENTRY_PROJECT -e INPUT_ENVIRONMENT -e INPUT_SOURCEMAPS -e INPUT_VERSION -e INPUT_VERSION_PREFIX -e INPUT_FINALIZE -e INPUT_STARTED_AT -e INPUT_SET_COMMITS -e INPUT_PROJECTS -e INPUT_URL_PREFIX -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/forms-frontend/forms-frontend":"/github/workspace" sentryintegrations/sentry-github-action-release:latest
2021-03-10T16:42:10.6436287Z ##[error]Environment variable SENTRY_AUTH_TOKEN is missing an auth token

I can't link to a specific section of the raw logs, but it is towards the very bottom of the link.

The workflow config is available here:
https://github.com/python-discord/forms-frontend/actions/runs/653317602/workflow

I can provide more info as needed.

Release created without commits and no info on how to move forward

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
getsentry/action-release@v1

Steps to Reproduce

I've followed the intructions to configure getsentry/action-release

  1. I've declared an Internal Integration, with the appropriate permissions (Release - Admin, Organization - Read).
  2. I've edited my github workflow to fetch all commits from all branches on checkout
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
  1. I've added to my github workflow a step:
     - 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
  1. My workflow is scheduled to be executed on commits on the release branch, I've then pushed a few commits.

Expected Result

Release should be created in sentry.io and the related commits should be shown, i.e. the list of new commits, not included in the previous release.

Actual Result

No commit information is shown on sentry.io
image

No log on github action side
image

New release checklist for [version number]

You can see the action released in here.

Checklist for a new release:

  • Create a PR that bumps the version in package.json and merge it
  • Once merged, visit the releases page
    • Create a new release
    • Name the release (You can use the version number if you want)
    • Describe the release by looking at what commits landed on master since the last release
    • Create a new tag by entering it in the drop down
      • If it's a security update, tag is a patch release
      • If it's just some improvements or bug fix, tag is a minor release
      • If there are breaking changes, tag it as a major release
        • Figure out if we need to do an external annoucement of sorts
  • Once published, visit the marketplace to see that the release is showing up

Allow setting stripCommonPrefix

I'm building a sourcemap with esbuild but somehow end up with a files referenced as /../../../src/config.ts. So quickest solution to fix this seems to be the --strip-common-prefix (which is for my case /../../../

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!

Github action warning

Hi, when I use this action on Production, there is a warning from this module.
The warning from Github is:

Unexpected input(s) 'version', valid inputs are ['entryPoint', 'args', 'environment', 'sourcemaps', 'finalize', 'started_at']

I believe it is because of the version input from the yml file.
My yml file is

# master.yml
...
- uses: getsentry/[email protected]
  with:
      environment: production
      sourcemaps: './dist'
      version: 1.1.1

The release recorded from Sentry is correct and reflect the correct version from the yml file so It is not a big issue.

Support for decompressing gzip build (--decompress cli argument)

Local CLI

My build is minified, and I need to decompress using the CLI:

releases files v0.0.1 upload-sourcemaps --decompress build

Desired GitHub action

  name: Create Sentry release
  uses: getsentry/[email protected]
  env:
    SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
    SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
    SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
  with:
    environment: production
    sourcemaps: "./build"
    version: "${{ env.VERSION }}"
+   decompress: true

Thanks!

Allow Sourcemaps to be a array

It would be better if the source maps option would accept an array. Instead of:

sourcemaps: ./dist/bar ./out/bar

it would be:

sourcemaps:
  - ./dist/bar
  - ./out/bar

Allow to pass ext to the CLI

Looks like currently it's impossible to set the --ext argument of the CLI, this is important when using TypeScript.

Container action is only supported on Linux

Hello! I'm porting over my team's react native build pipeline from CircleCI to Github Actions and just discovered that this action is only supported on Linux containers.

Screen Shot 2021-05-28 at 10 05 51 AM

As a workaround, we're going to have to install sentry-cli and run the release command manually. It would be great to have this action work on macos as well!

Upgrade to latest CLI

It seems like the CLI in the Sentry Action release is stuck to 1.59, while 1.65 supports the ignore missing commit flag.

Option to skip set-commit

Getting this error, on premise without the github integration.
using personal access token for SENTRY_AUTH_TOKEN. It works from local sentry-cli

Error: Command failed: /action-release/dist/sentry-cli releases set-commits 03e3472 --auto
error: No repositories are configured in Sentry for your organization.

So an option to skip it or to set --local instead

Add option to set dist on sourcemaps

I'm using the Sentry Release action to create a release of my React Native app and part of that is uploading sourcemaps. Here's how I'm doing it:

- 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 }}
    VERSION_CODE: ${{ steps.get_version.outputs.VERSION_CODE }}
    VERSION_NAME: ${{ steps.get_version.outputs.VERSION_NAME }}
  with:
    environment: production
    version: com.a494studios.koreanconjugator@${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}
    url_prefix: app:///
    sourcemaps: android/app/build/generated/assets/react/release/index.android.bundle android/app/build/generated/sourcemaps/react/release/index.android.bundle.map

The problem is that the sourcemaps aren't working correctly because they're not being assigned a dist value. With the CLI I would use the --dist flag, but I don't see an option for that in the docs or in the source code. Is there any interest in adding a dist option to this action? I could probably make a PR to add that change in if it's desired.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.