├── .dockerignore ├── Dockerfile ├── LICENSE ├── README.md └── entrypoint.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .github 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM getsentry/sentry-cli:1.40.0 2 | 3 | LABEL "name"="sentry" 4 | LABEL "maintainer"="Juan Karam " 5 | LABEL "version"="1.0.0" 6 | 7 | LABEL "com.github.actions.name"="Sentry.io release management" 8 | LABEL "com.github.actions.description"="Sentry.io release support for GitHub Actions" 9 | LABEL "com.github.actions.icon"="activity" 10 | LABEL "com.github.actions.color"="green" 11 | 12 | LABEL "repository"="https://github.com/juankaram/sentry-release" 13 | LABEL "homepage"="https://github.com/juankaram/sentry-release" 14 | 15 | RUN apk add git 16 | 17 | COPY "entrypoint.sh" "/entrypoint.sh" 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | CMD ["help"] 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2018 Juan Karam, GitHub, Inc. and contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitHub Action to publish new Sentry.io releases 2 | 3 | Action wraps the [Sentry CLI](https://docs.sentry.io/cli/) to publish new releases on Sentry.io. 4 | 5 | ## Usage 6 | 7 | An example workflow to release a new Sentry version: 8 | 9 | ```hcl 10 | workflow "Release a new version" { 11 | on = "push" 12 | resolves = "release version" 13 | } 14 | 15 | action "release version" { 16 | uses = "juankaram/sentry-release@master" 17 | secrets = ["SENTRY_AUTH_TOKEN"] 18 | env = { 19 | SENTRY_ORG = "foo" 20 | SENTRY_PROJECT = "bar" 21 | ENVIRONMENT = "development" 22 | } 23 | } 24 | ``` 25 | 26 | ### Secrets 27 | 28 | - `SENTRY_AUTH_TOKEN` - **Required**. The authentication token to use for all communication with Sentry. ([more info](https://docs.sentry.io/cli/configuration/)) 29 | - `SENTRY_ORG` - **Required**. The slug of the organization to use for a command. 30 | - `SENTRY_PROJECT` - **Required**. The slug of the project to use for a command. 31 | 32 | ### Environment variables 33 | 34 | - `RELEASE_VERSION` - **Optional**. Custom version tag. Defaults to `${SENTRY_PROJECT}@$(git describe --always --long)`. 35 | 36 | ## Attribution 37 | 38 | Heavily inspired by [GitHub Actions](https://github.com/actions). 39 | 40 | ## License 41 | 42 | The Dockerfile and associated scripts and documentation in this project are released under the [MIT License](LICENSE). 43 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Respect RELEASE_VERSION if specified 6 | [ -n "$RELEASE_VERSION" ] || export RELEASE_VERSION="${SENTRY_PROJECT}@$(git describe --always --long)" 7 | 8 | # Capture output 9 | output=$( 10 | sentry-cli releases new $RELEASE_VERSION 11 | sentry-cli releases set-commits --auto $RELEASE_VERSION 12 | sentry-cli releases deploys $RELEASE_VERSION new -e $ENVIRONMENT 13 | ) 14 | 15 | # Preserve output for consumption by downstream actions 16 | echo "$output" > "${HOME}/${GITHUB_ACTION}.${log}" 17 | 18 | 19 | # Write output to STDOUT 20 | echo "$output" 21 | --------------------------------------------------------------------------------