• Stars
    star
    410
  • Rank 101,778 (Top 3 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GitHub Action for creating a release on Sentry

Sentry Release GitHub Action

NOTE: Currently only available for Linux runners. See this issue for more details.

Automatically create a Sentry release in a workflow.

A release is a version of your code that can be deployed to an environment. When you give Sentry information about your releases, you unlock a number of new features:

  • Determine the issues and regressions introduced in a new release
  • Predict which commit caused an issue and who is likely responsible
  • Resolve issues by including the issue number in your commit message
  • Receive email notifications when your code gets deployed

Additionally, releases are used for applying source maps to minified JavaScript to view original, untransformed source code. You can learn more about releases in the releases documentation.

Prerequisites

Create a Sentry Internal Integration

NOTE: You have to be an admin in your Sentry org to create this.

For this action to communicate securely with Sentry, you'll need to create a new internal integration. In Sentry, navigate to: Settings > Developer Settings > New Internal Integration.

Give your new integration a name (for example, "GitHub Action Release Integration”) and specify the necessary permissions. In this case, we need Admin access for “Release” and Read access for “Organization”.

View of internal integration permissions.

Click “Save” at the bottom of the page and grab your token, which you’ll use as your SENTRY_AUTH_TOKEN. We recommend you store this as an encrypted secret.

Usage

Adding the following to your workflow will create a new Sentry release and tell Sentry that you are deploying to the production environment.

- uses: actions/checkout@v3
  with:
    fetch-depth: 0

- 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: https://sentry.io/
  with:
    environment: production

Inputs

Environment Variables

name description default
SENTRY_AUTH_TOKEN [Required] Authentication token for Sentry. See installation. -
SENTRY_ORG [Required] The slug of the organization name in Sentry. -
SENTRY_PROJECT The slug of the project name in Sentry. One of SENTRY_PROJECT or projects is required. -
SENTRY_URL The URL used to connect to Sentry. (Only required for Self-Hosted Sentry) https://sentry.io/

Parameters

name description default
environment Set the environment for this release. E.g. "production" or "staging". Omit to skip adding deploy to release. -
finalize When false, omit marking the release as finalized and released. true
ignore_missing When the flag is set and the previous release commit was not found in the repository, will create a release with the default commits count instead of failing the command. false
ignore_empty When the flag is set, command will not fail and just exit silently if no new commits for a given release have been found. false
sourcemaps Space-separated list of paths to JavaScript sourcemaps. Omit to skip uploading sourcemaps. -
dist Unique identifier for the distribution, used to further segment your release. Usually your build number. -
started_at Unix timestamp of the release start date. Omit for current time. -
version Identifier that uniquely identifies the releases. Note: the refs/tags/ prefix is automatically stripped when version is github.ref. ${{ github.sha }}
version_prefix Value prepended to auto-generated version. For example "v". -
set_commits Specify whether to set commits for the release. Either "auto" or "skip". "auto"
projects Space-separated list of paths of projects. When omitted, falls back to the environment variable SENTRY_PROJECT to determine the project. -
url_prefix Adds a prefix to source map urls after stripping them. -
strip_common_prefix Will remove a common prefix from uploaded filenames. Useful for removing a path that is build-machine-specific. false
working_directory Directory to collect sentry release information from. Useful when collecting information from a non-standard checkout directory. -

Examples

  • Create a new Sentry release for the production environment and upload JavaScript source maps from the ./lib directory.

    - uses: getsentry/action-release@v1
      with:
        environment: 'production'
        sourcemaps: './lib'
  • Create a new Sentry release for the production environment of your project at version v1.0.1.

    - uses: getsentry/action-release@v1
      with:
        environment: 'production'
        version: 'v1.0.1'
  • Create a new Sentry release for Self-Hosted Sentry

    - uses: getsentry/action-release@v1
      env:
        SENTRY_URL: https://sentry.example.com/

Releases

The build.yml workflow will build a Docker image every time a pull request merges to master and upload it to the Github registry, thus, effectively being live for everyone even if we do not bump the version.

NOTE: Unfortunately, we only use the latest tag for the Docker image, thus, making use of a version with the action innefective (e.g. v1 vs v1.3.0). See #129 on how to fix this.

NOTE: Right now, our Docker image publishing is decoupled from tag creation in the repository. We should only publish a specific Docker tag when we create a tag (you can make GitHub workflows listen to this). See #102 for details. Once this is fixed merges to master will not make the Docker image live and the following paragraph will be legit.

When you are ready to make a release, open a new release checklist issue and follow the steps in there.

The Docker build is multi-staged in order to make the final image used by the action as small as possible to reduce network transfer (use docker images to see the sizes of the images).

End to end testing on Github's CI

The first job in test.yml has instructions on how to tweak a job in order to execute your changes as part of the PR.

NOTE: Contributors will need to create an internal integration in their Sentry org and need to be an admin. See Prerequisites section above.

Members of this repo will not have to set anything up since the integration is already set-up. Just open the PR and you will see a release created for your PR.

Development

If your change impacts the options used for the action, you need to update the README.md with the new options.

Unit tests

You can run the unit tests with yarn test.

Contributing

See the Contributing Guide.

License

See the License File.

Troubleshooting

Suggestions and issues can be posted on the repository's issues page.

  • Forgetting to include the required environment variables (SENTRY_AUTH_TOKEN, SENTRY_ORG, and SENTRY_PROJECT), yields an error that looks like:

    Environment variable SENTRY_ORG is missing an organization slug
    
  • Building and running this action locally on an unsupported environment yields an error that looks like:

    Syntax error: end of file unexpected (expecting ")")
    
  • When adding the action, make sure to first checkout your repo with actions/checkout@v3. Otherwise it could fail at the propose-version step with the message:

    error: Could not automatically determine release name
    
  • In actions/checkout@v3 the default fetch depth is 1. If you're getting the error message:

    error: Could not find the SHA of the previous release in the git history. Increase your git clone depth.
    

    you can fetch all history for all branches and tags by setting the fetch-depth to zero like so:

    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
    

More Repositories

1

sentry

Developer-first error tracking and performance monitoring
Python
36,992
star
2

sentry-javascript

Official Sentry SDKs for JavaScript
TypeScript
7,600
star
3

self-hosted

Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept
Shell
7,130
star
4

responses

A utility for mocking out the Python Requests library.
Python
4,030
star
5

sentry-php

The official PHP SDK for Sentry (sentry.io)
PHP
1,779
star
6

raven-python

Raven is the legacy Python client for Sentry (getsentry.com) — replaced by sentry-python
Python
1,678
star
7

sentry-python

The official Python SDK for Sentry.io
Python
1,533
star
8

sentry-react-native

Official Sentry SDK for React-Native
TypeScript
1,509
star
9

sentry-laravel

The official Laravel SDK for Sentry (sentry.io)
PHP
1,157
star
10

sentry-java

A Sentry SDK for Java, Android and other JVM languages.
Kotlin
1,097
star
11

sentry-ruby

Sentry SDK for Ruby
Ruby
909
star
12

sentry-go

The official Go SDK for Sentry (sentry.io)
Go
864
star
13

sentry-cli

A command line utility to work with Sentry.
Rust
833
star
14

milksnake

A setuptools/wheel/cffi extension to embed a binary data in wheels
Python
764
star
15

sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
Objective-C
762
star
16

sentry-symfony

The official Symfony SDK for Sentry (sentry.io)
PHP
673
star
17

sentry-webpack-plugin

Repo moved to https://github.com/getsentry/sentry-javascript-bundler-plugins. Please open any issues/PRs there.
JavaScript
662
star
18

freight

Freight is a service which aims to make application deployments better.
Python
610
star
19

sentry-elixir

The official Elixir SDK for Sentry (sentry.io)
Elixir
597
star
20

raven-go

Sentry client in Go
Go
560
star
21

sentry-dotnet

Sentry SDK for .NET
C#
551
star
22

sentry-rust

Official Sentry SDK for Rust
Rust
515
star
23

raven-node

A standalone (Node.js) client for Sentry
JavaScript
457
star
24

symbolic

Stack trace symbolication library written in Rust
Rust
420
star
25

sentry-kubernetes

Kubernetes event reporter for Sentry
Python
408
star
26

sentry-native

Sentry SDK for C, C++ and native applications.
C
354
star
27

docker-sentry

Docker Official Image packaging for Sentry
Python
348
star
28

pdb

A parser for Microsoft PDB (Program Database) debugging information
Rust
342
star
29

symbolicator

Native Symbolication as a Service
Rust
328
star
30

sentry-docs

Sentry's documentation (and tools to build it)
MDX
313
star
31

rb

Routing and connection management for Redis in Python
Python
300
star
32

sentry-php-sdk

This is a meta package to ship sentry-php with a recommend http client.
298
star
33

spotlight

Your Universal Debug Toolbar
TypeScript
290
star
34

snuba

Search the seas for your lost treasure.
Python
272
star
35

relay

Sentry event forwarding and ingestion service.
Rust
246
star
36

raven-csharp

Superseded by: https://github.com/getsentry/sentry-dotnet
C#
232
star
37

sentry-electron

The official Sentry SDK for Electron
TypeScript
217
star
38

sentry-plugins

Official plugins for Sentry server
Python
212
star
39

zeus

WIP: A dashboard for CI
Python
209
star
40

rust-sourcemap

A library for rust that implements basic sourcemap handling
Rust
188
star
41

sentry-unity

Development of Sentry SDK for Unity
C#
187
star
42

action-github-app-token

Gets a GitHub auth token for a GitHub App installation
TypeScript
179
star
43

sentry-wizard

Sentry Project Setup Wizard
TypeScript
139
star
44

sentry-slack

DEPRECATED Slack integration for Sentry
Python
135
star
45

sentry-fastlane-plugin

Official fastlane plugin for Sentry
Ruby
131
star
46

sentry-android-gradle-plugin

Gradle plugin for Sentry Android. Upload proguard, debug files, and more.
Kotlin
130
star
47

action-git-diff-suggestions

This GitHub Action will take the current git changes and apply them as GitHub code review suggestions
TypeScript
122
star
48

craft

The universal Sentry release CLI 🚀
TypeScript
118
star
49

examples

Collection of all different kinds of Sentry SDKs and integrations
C#
118
star
50

sentry-javascript-bundler-plugins

JavaScript Bundler Plugins for Sentry
TypeScript
115
star
51

sentry-capacitor

The official Sentry SDK for Capacitor
TypeScript
114
star
52

sentry-kotlin-multiplatform

Sentry SDK for Kotlin Multiplatform
Kotlin
104
star
53

raven-objc

This SDK is deprecated. Use https://github.com/getsentry/sentry-cocoa
Objective-C
98
star
54

sentry-clj

Sentry SDK for Clojure
Clojure
98
star
55

sentry-jira

A Plugin for sentry that lets you create JIRA issues
Python
95
star
56

raven-aiohttp

An aiohttp transport for raven-python
Python
90
star
57

sentry-android

MOVED: https://github.com/getsentry/sentry-java
87
star
58

pytest-responses

py.test integration for responses
Python
83
star
59

sentry-github

A Sentry extension which integrates with GitHub.
Python
79
star
60

libsourcemap

DEPRECATED: Implements efficient sourcemap processing for Python in Rust
Rust
78
star
61

sentry-rrweb

Moved to: https://github.com/getsentry/sentry-javascript/tree/master/packages/replay#sentry-session-replay
TypeScript
73
star
62

sentry-unreal

Unreal Engine
C++
71
star
63

sentry-cordova

The official Sentry SDK for Cordova
TypeScript
68
star
64

sentry-dart-plugin

A Dart Build Plugin that uploads debug symbols for Android, iOS/macOS and source maps for Web to Sentry via sentry-cli
Dart
63
star
65

sourcemaps.io

Web-based Source Map validator
TypeScript
58
star
66

breakpad-tools

Prebuilt tools and examples to work with Breakpad's minidumps
Makefile
53
star
67

sentry-webhooks

An extension for Sentry which allows creation various web hooks.
Python
52
star
68

dotnet-assembly-alias

Tool to rename .NET assemblies and references
C#
50
star
69

sentry-netlify-build-plugin

The Sentry Netlify build plugin automatically notifies Sentry of new releases being deployed to your site.
JavaScript
45
star
70

develop

TypeScript
43
star
71

babel-gettext-extractor

A fork of babel-gettext-plugin that works with older versions of node and supports comment and location extraction
JavaScript
43
star
72

sentry-mobile-release-health-app

Sentry Mobile App
Dart
42
star
73

sentry-xamarin

Sentry for Xamarin Native and Xamarin.Forms
C#
41
star
74

raven-swift

This SDK is deprecated. Use https://github.com/getsentry/sentry-cocoa
40
star
75

pytest-sentry

Track flaky tests in Sentry
Python
39
star
76

sentry-auth-github

GitHub SSO provider for Sentry
Python
39
star
77

action-visual-snapshot

Save and compare your visual snapshots
TypeScript
38
star
78

sentry-fullstory

The Sentry-FullStory integration seamlessly integrates the Sentry and FullStory platforms.
TypeScript
37
star
79

sentry-phabricator

A Sentry extension which integrates with Phabricator
Python
36
star
80

platformicons

A platform and framework icon font.
TypeScript
36
star
81

arroyo

A library to build streaming applications that consume from and produce to Kafka.
Python
35
star
82

sentry-auth-google

Google Apps SSO provider for Sentry
Python
34
star
83

integration-platform-example

An example kanban application which explores the ways developers can build apps on Sentry's integration platform
TypeScript
32
star
84

unity

Unity SDK UPM package
Objective-C
31
star
85

vanguard

TypeScript
29
star
86

profiling-node

The code for this repo now lives in https://github.com/getsentry/sentry-javascript/tree/develop/packages/profiling-node
TypeScript
28
star
87

sentry-vscode

VSCode editor integration for Sentry
TypeScript
28
star
88

probot-report

Probot app that sends periodic reminder emails for outstanding PR reviews
JavaScript
28
star
89

hackweek-coda

A queue thing with a sprinkle of Italian
Python
27
star
90

sentry-replay

Moved to http://github.com/getsentry/sentry-javascript
TypeScript
27
star
91

symbol-collector

Clients and Server to collect system symbols.
C#
27
star
92

perl-raven

A perl sentry client
Perl
26
star
93

sentry_airflow

Airflow integration with Sentry (https://sentry.io)
Python
26
star
94

cloud-run-typescript-template

Template for Google Cloud Run (typescript)
JavaScript
24
star
95

symsynd

C++
23
star
96

sentry-relay-attic

A relay server for Sentry (https://getsentry.com)
Rust
23
star
97

freight-cli

A command line interface to Freight
Python
22
star
98

xds

xDS service for Envoy
Go
22
star
99

gib-potato

More Potato, more awesome 🥔
PHP
21
star
100

sentry-dotnet-minidump

Capture Minidump of .NET Applications
C
21
star