Skip to content

Commit

Permalink
feat: add context
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-elliott committed Apr 21, 2022
1 parent 90c5720 commit dea2355
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
20 changes: 18 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,25 @@ async function run() {
token: token
};

const changelogOpts = {
preset: "angular"
};

const repository = process.env.GITHUB_REPOSITORY;

core.info(`Repository detected as ${repository}.`);

const i = repository.indexOf("/");
const context = {
owner: repository.substring(0, i),
repository: repository.substring(i + 1)
}

core.info(`Context is ${context}.`)

core.info(`Attempting Conventional GitHub Release.`);

release(auth, {preset: "angular"}, function(err, responses) {
release(auth, changelogOpts, context, function(err, responses) {
if (err !== null) {
core.setFailed(`An error occurred creating the release: ${err}`);

Expand All @@ -46,7 +62,7 @@ async function run() {
}
});
} catch (error) {
core.setFailed(error.message);
core.setFailed(`An exception occurred calling the release module: ${error.message}`);
}
}

Expand Down

0 comments on commit dea2355

Please sign in to comment.