Skip to content

Commit 4569d5b

Browse files
authored
feat(sourcemaps)!: Enable injecting debug ids by default (#272)
1 parent e9b056f commit 4569d5b

File tree

6 files changed

+52
-15
lines changed

6 files changed

+52
-15
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ repos:
55
rev: v5.0.0
66
hooks:
77
- id: trailing-whitespace
8+
exclude: '^dist/.*'
89
- id: end-of-file-fixer
10+
exclude: '^dist/.*'
911
- id: check-yaml
1012
- repo: local
1113
hooks:

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## 3.0.0
4+
5+
Version `3.0.0` contains breaking changes:
6+
7+
- feat(sourcemaps)!: Enable injecting debug ids by default (#272) by @andreiborza
8+
9+
The action now automatically injects Debug IDs into your JavaScript source files and source maps to ensure your stacktraces can be
10+
properly un-minified.
11+
12+
This is a **breaking change as it modifies your source files**. You can disable this behavior by setting `inject: false`:
13+
14+
```yaml
15+
- uses: getsentry/action-release@v3
16+
with:
17+
environment: 'production'
18+
sourcemaps: './dist'
19+
inject: false
20+
```
21+
22+
Read more about [Artifact Bundles and Debug IDs here](https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/artifact-bundles/).
23+
324
## 1.11.0
425
526
- feat: Use hybrid docker/composite action approach (#265) by @andreiborza

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ Additionally, releases are used for applying [source maps](https://docs.sentry.i
2323

2424
## What's new
2525

26+
Version `3.0.0` contains breaking changes:
27+
28+
- feat(sourcemaps)!: Enable injecting debug ids by default (#272) by @andreiborza
29+
30+
The action now automatically injects Debug IDs into your JavaScript source files and source maps to ensure your stacktraces can be
31+
properly un-minified.
32+
33+
This is a **breaking change as it modifies your source files**. You can disable this behavior by setting `inject: false`.
34+
2635
Please refer to the [release page](https://github.com/getsentry/action-release/releases) for the latest release notes.
2736

2837
## Prerequisites
@@ -42,7 +51,7 @@ Adding the following to your workflow will create a new Sentry release and tell
4251
fetch-depth: 0
4352

4453
- name: Create Sentry release
45-
uses: getsentry/action-release@v1
54+
uses: getsentry/action-release@v3
4655
env:
4756
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
4857
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
@@ -68,8 +77,8 @@ Adding the following to your workflow will create a new Sentry release and tell
6877
| name | description |default|
6978
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
7079
| `environment` | Set the environment for this release. E.g. "production" or "staging". Omit to skip adding deploy to release. |-|
71-
| `inject` | Injects Debug IDs into source files and sourcemaps. We **strongly recommend enabling** this to ensure proper un-minifaction of your stacktraces. |`false`|
7280
| `sourcemaps` | Space-separated list of paths to JavaScript sourcemaps. Omit to skip uploading sourcemaps. |-|
81+
| `inject` | Injects Debug IDs into source files and source maps to ensure proper un-minifcation of your stacktraces. Does nothing if `sourcemaps` was not set. |`true`|
7382
| `finalize` | When false, omit marking the release as finalized and released. |`true`|
7483
| `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`|
7584
| `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`|
@@ -88,20 +97,19 @@ Adding the following to your workflow will create a new Sentry release and tell
8897

8998
### Examples
9099

91-
- Create a new Sentry release for the `production` environment, inject Debug IDs into JavaScript source files and sourcemaps and upload them from the `./dist` directory.
100+
- Create a new Sentry release for the `production` environment, inject Debug IDs into JavaScript source files and source maps and upload them from the `./dist` directory.
92101

93102
```yaml
94-
- uses: getsentry/action-release@v1
103+
- uses: getsentry/action-release@v3
95104
with:
96105
environment: 'production'
97-
inject: true
98106
sourcemaps: './dist'
99107
```
100108

101109
- Create a new Sentry release for the `production` environment of your project at version `v1.0.1`.
102110

103111
```yaml
104-
- uses: getsentry/action-release@v1
112+
- uses: getsentry/action-release@v3
105113
with:
106114
environment: 'production'
107115
version: 'v1.0.1'
@@ -110,7 +118,7 @@ Adding the following to your workflow will create a new Sentry release and tell
110118
- Create a new Sentry release for [Self-Hosted Sentry](https://develop.sentry.dev/self-hosted/)
111119

112120
```yaml
113-
- uses: getsentry/action-release@v1
121+
- uses: getsentry/action-release@v3
114122
env:
115123
SENTRY_URL: https://sentry.example.com/
116124
```
@@ -177,7 +185,7 @@ Otherwise it could fail at the `propose-version` step with the message:
177185
with:
178186
fetch-depth: 0
179187
180-
- uses: getsentry/action-release@v1
188+
- uses: getsentry/action-release@v3
181189
with:
182190
environment: 'production'
183191
version: 'v1.0.1'

action.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ inputs:
66
environment:
77
description: 'Set the environment for this release. E.g. "production" or "staging". Omit to skip adding deploy to release.'
88
required: false
9-
inject:
10-
description: 'Injects Debug IDs into source files and sourcemaps. We strongly recommend enabling this to ensure proper un-minifaction of your stacktraces.'
11-
required: false
129
sourcemaps:
13-
description: 'Space-separated list of paths to JavaScript sourcemaps. Omit to skip uploading sourcemaps.'
10+
description: 'Space-separated list of paths to JavaScript source maps. Omit to skip uploading sourcemaps.'
11+
required: false
12+
inject:
13+
description: 'Injects Debug IDs into source files and source maps to ensure proper un-minifcation of your stacktraces. Does nothing if `sourcemaps` was not set.'
14+
default: true
1415
required: false
1516
dist:
1617
description: 'Unique identifier for the distribution, used to further segment your release. Usually your build number.'
@@ -20,9 +21,11 @@ inputs:
2021
default: true
2122
ignore_missing:
2223
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.'
24+
default: false
2325
required: false
2426
ignore_empty:
2527
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.'
28+
default: false
2629
required: false
2730
started_at:
2831
description: 'Unix timestamp of the release start date. Omit for current time.'
@@ -44,15 +47,18 @@ inputs:
4447
required: false
4548
strip_common_prefix:
4649
description: 'Will remove a common prefix from uploaded filenames. Useful for removing a path that is build-machine-specific.'
50+
default: false
4751
required: false
4852
working_directory:
4953
description: 'Directory to collect sentry release information from. Useful when collecting information from a non-standard checkout directory.'
5054
required: false
5155
disable_telemetry:
5256
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.'
57+
default: false
5358
required: false
5459
disable_safe_directory:
5560
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.'
61+
default: false
5662
required: false
5763

5864
runs:
@@ -84,7 +90,7 @@ runs:
8490
INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }}
8591
INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }}
8692
INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }}
87-
uses: docker://ghcr.io/getsentry/action-release-image:master
93+
uses: docker://ghcr.io/getsentry/action-release-image:ab-inject-by-default
8894

8995
# For actions running on macos or windows runners, we use a composite
9096
# action approach which allows us to install the arch specific sentry-cli

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122728,7 +122728,7 @@ const telemetry_1 = __nccwpck_require__(12417);
122728122728
// Validate options first so we can fail early.
122729122729
options.checkEnvironmentVariables();
122730122730
const environment = options.getEnvironment();
122731-
const inject = options.getBooleanOption('inject', false);
122731+
const inject = options.getBooleanOption('inject', true);
122732122732
const sourcemaps = options.getSourcemaps();
122733122733
const dist = options.getDist();
122734122734
const shouldFinalize = options.getBooleanOption('finalize', true);

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ withTelemetry(
2222
options.checkEnvironmentVariables();
2323

2424
const environment = options.getEnvironment();
25-
const inject = options.getBooleanOption('inject', false);
25+
const inject = options.getBooleanOption('inject', true);
2626
const sourcemaps = options.getSourcemaps();
2727
const dist = options.getDist();
2828
const shouldFinalize = options.getBooleanOption('finalize', true);

0 commit comments

Comments
 (0)