Skip to content

Commit

Permalink
integration merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanmars committed May 24, 2024
2 parents d110f47 + d697771 commit e0290b6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
15 changes: 14 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ inputs:

name:
description: >
Name of the package
Not used, use package instead.
required: false
deprecationMessage: Input `name` is no longer used. Use `package` instead!

keep-n-untagged:
description: >
Expand Down Expand Up @@ -56,6 +57,18 @@ inputs:
Simulate action - does not remove any packages
required: false

repository:
description: >
The github repository where the package is stored. Defaults to repository
name.
required: false

package:
description: >
The package name, replaces the `name` input. Defaults to the repository
name.
required: false

runs:
using: node20
main: dist/index.js
8 changes: 8 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32750,6 +32750,8 @@ exports.Config = Config;
function getConfig() {
const token = core.getInput('token', { required: true });
const config = new Config(token);
config.repository = core.getInput('repository');
config.package = core.getInput('package');
// auto populate
const GITHUB_REPOSITORY = process.env['GITHUB_REPOSITORY'];
if (GITHUB_REPOSITORY) {
Expand All @@ -32765,6 +32767,12 @@ function getConfig() {
config.repository = parts[1];
}
}
else {
throw Error(`Error parsing GITHUB_REPOSITORY: ${GITHUB_REPOSITORY}`);
}
}
else {
throw Error('GITHUB_REPOSITORY is not set');
}
config.tags = core.getInput('tags');
config.excludeTags = core.getInput('exclude-tags');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export class Config {
export function getConfig(): Config {
const token: string = core.getInput('token', { required: true })
const config = new Config(token)
config.repository = core.getInput('repository')
config.package = core.getInput('package')

// auto populate
const GITHUB_REPOSITORY = process.env['GITHUB_REPOSITORY']
Expand All @@ -47,7 +49,11 @@ export function getConfig(): Config {
if (!config.repository) {
config.repository = parts[1]
}
} else {
throw Error(`Error parsing GITHUB_REPOSITORY: ${GITHUB_REPOSITORY}`)
}
} else {
throw Error('GITHUB_REPOSITORY is not set')
}

config.tags = core.getInput('tags')
Expand Down

0 comments on commit e0290b6

Please sign in to comment.