Skip to content

[WIP] add inject option #165 #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Adding the following to your workflow will create a new Sentry release and tell
|`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.|-|
|`inject`|Fixes up JavaScript source files and sourcemaps with debug ids.|`false`|
|`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`._|<code>${{&nbsp;github.sha&nbsp;}}</code>|
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
sourcemaps:
description: 'Space-separated list of paths to JavaScript sourcemaps. Omit to skip uploading sourcemaps.'
required: false
inject:
description: 'Fixes up JavaScript source files and sourcemaps with debug ids.'
required: false
dist:
description: 'Unique identifier for the distribution, used to further segment your release. Usually your build number.'
required: false
Expand Down
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as process from 'process';
options.checkEnvironmentVariables();

const environment = options.getEnvironment();
const inject = options.getBooleanOption('inject', false);
const sourcemaps = options.getSourcemaps();
const dist = options.getDist();
const shouldFinalize = options.getBooleanOption('finalize', true);
Expand Down Expand Up @@ -44,6 +45,15 @@ import * as process from 'process';
});
}

if (inject) {
if (sourcemaps.length) {
core.debug('Injecting sourcemaps with debug ids');
await cli.execute(['sourcemaps', 'inject', ...sourcemaps], true);
} else {
core.warning(`Inject was specified without also specifying sourcemaps`);
}
}

if (sourcemaps.length) {
core.debug(`Adding sourcemaps`);
await Promise.all(
Expand Down