Skip to content

Commit

Permalink
Summary fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Aug 17, 2024
1 parent b32f139 commit 7df233d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "execute-whitelist-action",
"version": "1.0.7",
"version": "1.0.8",
"description": "Action to whitelist executions",
"main": "index.ts",
"scripts": {
Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,18 @@ async function run() {

if (allowedUserIds.includes(userId)) {
core.notice(`${styles.green.open}User ${styles.bold.open}${userId}${styles.bold.close} authorized this workflow run.${styles.green.close}`);
core.summary.clear()
core.summary.addHeading("Action Authorization");
core.summary.addBreak()
core.summary.addRaw("This workflow run is authorized by ");
core.summary.addLink(`${username} (${userId})`, `https://github.com/${username}`)
core.summary.addRaw(".");
core.summary.write()
} else {
core.notice(`${styles.green.open}User ${styles.bold.open}${userId}${styles.bold.close} authorized this workflow run.${styles.green.close}`);
core.summary.clear()
core.summary.addHeading("Action Authorization Failure");
core.summary.addBreak()
core.summary.addRaw("This workflow run was executed by ");
core.summary.addLink(`${username} (${userId})`, `https://github.com/${username}`)
core.summary.addRaw(" and is unauthorized!");
core.summary.write()
throw new Error(`User ${styles.bold.open}${userId}${styles.bold.close} is not authorized to run this workflow. Aborting`);
}
} catch (error: any) {
Expand Down

0 comments on commit 7df233d

Please sign in to comment.