name: 'Sentry Release' description: 'GitHub Action for creating a release on Sentry' author: 'Sentry' inputs: environment: description: 'Set the environment for this release. E.g. "production" or "staging". Omit to skip adding deploy to release.' required: false inject: description: 'Injects Debug IDs into source files and sourcemaps. We strongly recommend enabling this to ensure proper un-minifaction of your stacktraces.' required: false sourcemaps: description: 'Space-separated list of paths to JavaScript sourcemaps. Omit to skip uploading sourcemaps.' required: false dist: description: 'Unique identifier for the distribution, used to further segment your release. Usually your build number.' required: false finalize: description: 'When false, omit marking the release as finalized and released.' default: true ignore_missing: description: '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.' required: false ignore_empty: description: 'When the flag is set, command will not fail and just exit silently if no new commits for a given release have been found.' required: false started_at: description: 'Unix timestamp of the release start date. Omit for current time.' required: false version: description: 'Identifier that uniquely identifies the releases. Omit to auto-generate one.' required: false version_prefix: description: 'Value prepended to auto-generated version.' required: false set_commits: description: 'Specify whether to set commits for the release. Either "auto" or "skip".' required: false projects: description: 'Space-separated list of projects. Defaults to the env variable "SENTRY_PROJECT" if not provided.' required: false url_prefix: description: 'Adds a prefix to source map urls after stripping them.' required: false strip_common_prefix: description: 'Will remove a common prefix from uploaded filenames. Useful for removing a path that is build-machine-specific.' required: false working_directory: description: 'Directory to collect sentry release information from. Useful when collecting information from a non-standard checkout directory.' required: false disable_telemetry: description: 'The action sends telemetry data and crash reports to Sentry. This helps us improve the action. You can turn this off by setting this flag.' required: false disable_safe_directory: description: 'The action needs access to the repo it runs in. For that we need to configure git to mark the repo as a safe directory. You can turn this off by setting this flag.' required: false runs: using: 'composite' steps: # For actions running on a linux runner, we use a docker # approach as it's faster and encapsulates everything needed # to run the action. - name: Run docker image if: runner.os != 'macOS' && runner.os != 'Windows' env: # Composite actions don't pass the outer action's inputs # down into these steps, so we have to replicate all inputs to be accessible # via @actions/core here and in the `Run Release Action` step further down. INPUT_ENVIRONMENT: ${{ inputs.environment }} INPUT_INJECT: ${{ inputs.inject }} INPUT_SOURCEMAPS: ${{ inputs.sourcemaps }} INPUT_DIST: ${{ inputs.dist }} INPUT_FINALIZE: ${{ inputs.finalize }} INPUT_IGNORE_MISSING: ${{ inputs.ignore_missing }} INPUT_IGNORE_EMPTY: ${{ inputs.ignore_empty }} INPUT_STARTED_AT: ${{ inputs.started_at }} INPUT_VERSION: ${{ inputs.version }} INPUT_VERSION_PREFIX: ${{ inputs.version_prefix }} INPUT_SET_COMMITS: ${{ inputs.set_commits }} INPUT_PROJECTS: ${{ inputs.projects }} INPUT_URL_PREFIX: ${{ inputs.url_prefix }} INPUT_STRIP_COMMON_PREFIX: ${{ inputs.strip_common_prefix }} INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }} INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }} INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }} uses: docker://ghcr.io/getsentry/action-release-image:1.11.0 # For actions running on macos or windows runners, we use a composite # action approach which allows us to install the arch specific sentry-cli # binary that's needed for the runner. # This is slower than the docker approach but runs on macos and windows. - name: Mark GitHub workspace a safe directory in git if: ${{ (runner.os == 'macOS' || runner.os == 'Windows') && inputs.disable_safe_directory != 'true' }} shell: bash run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Setup node if: runner.os == 'macOS' || runner.os == 'Windows' uses: actions/setup-node@v4 with: # setup-node doesn't allow absolute paths, so we can't # just use `github.action_path` to read this out from the `package.json` # any changes to the runtime need to be reflected here node-version: 18.17.0 - name: Install Sentry CLI v2 if: runner.os == 'macOS' || runner.os == 'Windows' shell: bash run: npm install --no-package-lock @sentry/cli@^2.4 working-directory: ${{ github.action_path }} - name: Run Release Action if: runner.os == 'macOS' || runner.os == 'Windows' env: # Composite actions don't pass the outer action's inputs # down into these steps, so we have to replicate all inputs to be accessible # via @actions/core INPUT_ENVIRONMENT: ${{ inputs.environment }} INPUT_INJECT: ${{ inputs.inject }} INPUT_SOURCEMAPS: ${{ inputs.sourcemaps }} INPUT_DIST: ${{ inputs.dist }} INPUT_FINALIZE: ${{ inputs.finalize }} INPUT_IGNORE_MISSING: ${{ inputs.ignore_missing }} INPUT_IGNORE_EMPTY: ${{ inputs.ignore_empty }} INPUT_STARTED_AT: ${{ inputs.started_at }} INPUT_VERSION: ${{ inputs.version }} INPUT_VERSION_PREFIX: ${{ inputs.version_prefix }} INPUT_SET_COMMITS: ${{ inputs.set_commits }} INPUT_PROJECTS: ${{ inputs.projects }} INPUT_URL_PREFIX: ${{ inputs.url_prefix }} INPUT_STRIP_COMMON_PREFIX: ${{ inputs.strip_common_prefix }} INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }} INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }} INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }} shell: bash run: npm run start working-directory: ${{ github.action_path }} branding: icon: 'triangle' color: 'purple'