Files
action-release/action.yml
T
AndreiandFrancesco Gringl-Novy 24fbab5af5 chore(action): Rework action to be a composite action (#243)
* chore(action): Rework action to be a composite action

- Removed docker image and workflow around it
- Externalizing `@sentry/cli` so it can be installed per-runner
- Support versioning of actions publishing major, minor and patch tags allowing
  users to pin versions
- Reduce action run time by 80% as a result

Closes: #185, #193, #233

* Fix path

* Add @sentry/cli as dev dep so we can build locally but have it overwritten on
the CI by the install step

* Improve changelog

* Update .github/workflows/test.yml

Co-authored-by: Francesco Gringl-Novy <[email protected]>

* Remove caching of yarn cache

* Remove volta in action itself

* Remove fetch depths for ci tests

* Pin @sentry/cli to ~2.4

* Change to `^2.4`

* Read out workspace path directly in action

* Add comment

* Run lint and format

* Add lint step to test.yml

* Simplify workingDirectory checks

---------

Co-authored-by: Francesco Gringl-Novy <[email protected]>
2025-02-06 14:08:01 +01:00

90 lines
3.9 KiB
YAML

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
runs:
using: 'composite'
steps:
- name: Install Sentry CLI v2
shell: bash
run: yarn add --dev --no-lockfile @sentry/cli@^2.4
working-directory: ${{ github.action_path }}
- name: Run Release Action
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 }}
shell: bash
run: yarn start
working-directory: ${{ github.action_path }}
branding:
icon: 'triangle'
color: 'purple'