Skip to content

Commit

Permalink
test: add coverage (actions#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored Oct 6, 2023
1 parent 9b28355 commit bdb2377
Show file tree
Hide file tree
Showing 6 changed files with 1,691 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
.env
coverage
node_modules/
3 changes: 2 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export async function main(
authorization: `bearer ${appAuthentication.token}`,
},
}).catch((error) => {
/* c8 ignore next */
if (error.status !== 404) throw error;

// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app
Expand All @@ -122,7 +123,7 @@ export async function main(
core.setSecret(authentication.token);

core.setOutput("token", authentication.token);

// Make token accessible to post function (so we can invalidate it)
if (!skipTokenRevoke) {
core.saveState("token", authentication.token);
Expand Down
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ main(
}),
skipTokenRevoke
).catch((error) => {
/* c8 ignore next 3 */
console.error(error);
core.setFailed(error.message);
});
Loading

0 comments on commit bdb2377

Please sign in to comment.