Giter Club home page Giter Club logo

setup-sentry-cli's Introduction

mathieu-bour/setup-sentry-cli

License Stars Latest release Workflow status

Install the Sentry CLI in your GitHub Actions workflow.

This action is not supported by Sentry.

Proudly maintained by Mathieu Bour, former Vice-CTO @mathrix-education.

Acknowledgements

This action was initially developed for Education Media SA. The repository is now maintained by @mathieu-bour.

Motivations

Installing Sentry CLI in GitHub Actions can be relevant in many cases. Mathrix Education SA is based on Angular, which produces sourcemaps. Therefore, we need to upload sourcemaps, during our compilation workflow.

There is an official guide to use sentry-cli on the Sentry's blog, but it requires to use a bunch of commands, which is not really straight forward.

There are also some Docker-based actions, but they are quite slow.

Usage

Supported operating systems

This action currently supports Ubuntu, Windows and Mac-OS based systems. The supported operating system matrix is the following:

Operating system Status
ubuntu-latest supported
macos-latest supported
windows-latest supported

This action also support ARM-based systems (armv7 and arm64), thanks to @paresy support.

Platform Architecture Status
linux x32 (i686) supported
linux x64 (x86_64) supported
linux arm (armv7) supported
linux arm64 (aarch64) supported
darwin x64 (x86_64) supported
darwin arm64 supported
win32 x32 (i686) supported
win32 x64 (x86_64) supported

Inputs

Name Type Default value
version 'latest' / string 'latest'
token string ''
url string ''
organization string ''
project string ''

See action.yml for details.

version

If you need a precise version of the Sentry CLI, you may provide this input. We strongly advise you to do so since using the latest version may break your workflow if Sentry releases a backward-incompatible version of the sentry-cli.

url

The Sentry server URL. By default, this action will configure the Sentry CLI to interact with official Sentry server which is https://sentry.io. If you use an on-premise instance, you may provide your server URL here.

token

This is the token which will be used by the Sentry CLI to authenticate against the Sentry server. Actually, this will export the SENTRY_AUTH_TOKEN environment variable, so the sentry-cli already can log into the server.

Organization Internal Integration (recommended)

This will generate a token that is tied to your organization. Go to Organization Settings > Developer Settings > + New Internal Integration. Fill the Name with a name of your choice (for example GitHub Actions); you will get a token that you can use a Sentry token.

If you plan to use this action to deploy releases, set the following permissions:

Name Access
Project No Access
Release Admin
Issue & Event No Access
Organization Read
Member No Access
Personal token

You can also create personal access token that are tied to your account and use them to impersonate your account. Simply go to Settings > API Keys > Create Next Token.

organization

Define the default organization; this will export the SENTRY_ORG environment variable.

project

Define the default project; this will export the SENTRY_PROJECT environment variable.

Examples

Minimal configuration

- uses: mathieu-bour/setup-sentry-cli@v2 # WARNING: see the latest stable version instead!

By default, this minimal example will install the latest version of the Sentry CLI, without any authentication.

Typical CI configuration

- name: Setup Sentry CLI
  uses: mathieu-bour/setup-sentry-cli@v1
  with:
    version: latest # optional if 'latest'
    url: https://sentry.yourcompany.com # optional if you are using https://sentry.io
    token: ${{ SECRETS.SENTRY_TOKEN }} # from GitHub secrets
    organization: my-org
    project: my-project

In this example, you provide an authentication token. The action automatically download the latest version of the Sentry CLI and authenticate using the provided token.

Then, the CLI is configured for the server https://sentry.yourcompany.com and the project my-project of the organization my-org.

You are now ready to use the Sentry CLI commands such as sentry-cli releases!

setup-sentry-cli's People

Contributors

dimitri-bret avatar mathieu-bour avatar

Stargazers

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

Watchers

 avatar

setup-sentry-cli's Issues

Update to Node 20

GitHub has deprecated the usage of Node 16:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: mathieu-bour/setup-sentry-cli@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Please would you upgrade.

Thanks for providing this action.

sentry-cli command not found

For some reason, my runner still can not find my sentry cli command...

My github action config:

	- name: Setup Sentry CLI
        uses: mathrix-education/[email protected]
        with:
          version: latest # optional if 'latest'
          url: https://sentry.io
          token: ${{ secrets.SENTRY_AUTH_TOKEN }} # from GitHub secrets
          organization: itexperts
          project: webreporttool

The result in the action runner (which looks good to me):
Screenshot 2020-09-30 at 10 45 41

When actually calling the sentry-cli command:
Screenshot 2020-09-30 at 10 46 01

Am I missing something here?

Set environment

Hi! I'm wondering if you have any plans to support an environment option so I use 'development' and 'production' depending on the action I'm trying to run (eg. test-can-build (development) vs deploy-production).

Sudo error when installing action

Hi, I am getting the following error when trying to use the 1.1.0 version of this action. mathieu-education/[email protected] works perfectly

FYI I am using a self-hosted Github Runner

Installing sentry-cli version latest
/usr/bin/sudo cp /Volumes/GithubRunner/_work/_temp/21ade878-4070-43bf-acc9-950995a963a8 /usr/local/bin/sentry-cli
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Error: Error: The process '/usr/bin/sudo' failed with exit code 1

Upgrade to Node 16 actions

Heyy!

First of all, thank you for this action!

GitHub deprecated the usage of Node 12 actions and I'm currently getting the following warnings while using the action:

Node.js 12 actions are deprecated.
For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
Please update the following actions to use Node.js 16: mathieu-bour/setup-sentry-cli

Therefore, it would be great to upgrade the setup!

version: latest seems to use most recent release instead of latest release

Hey Mathieu, thanks for creating this super useful action.

Most recent release is sometimes a backport (e.g. right now it's 1.75.1) which will break workflow that was using 2.x

switching to version: 2.17.4 which is Latest at the time of writing fixed my broken workflow which leads me to believe that using 1.75.1 is the root cause.

Screenshot 2023-04-27 at 1 40 57 PM

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.