Skip to content

Commit

Permalink
Fix buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Aug 17, 2024
1 parent b57fa59 commit 247dfe0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# execute-whitelist-action
Action to whitelist executions

<!--
npm run build && git add . && git commit -m "Fix buffer" && git tag -a -m "Buffer fix" v1.0.10 && git push --follow-tags && gh release create v1.0.10 --generate-notes
-->
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29258,19 +29258,23 @@ async function run() {
const userId = user.id.toString();
if (allowedUserIds.includes(userId)) {
core.notice(`${ansi_styles_1.default.green.open}User ${ansi_styles_1.default.bold.open}${userId}${ansi_styles_1.default.bold.close} authorized this workflow run.${ansi_styles_1.default.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({ overwrite: true });
}
else {
core.notice(`${ansi_styles_1.default.green.open}User ${ansi_styles_1.default.bold.open}${userId}${ansi_styles_1.default.bold.close} authorized this workflow run.${ansi_styles_1.default.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({ overwrite: true });
throw new Error(`User ${ansi_styles_1.default.bold.open}${userId}${ansi_styles_1.default.bold.close} is not authorized to run this workflow. Aborting`);
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "execute-whitelist-action",
"version": "1.0.9",
"version": "1.0.10",
"description": "Action to whitelist executions",
"main": "index.ts",
"scripts": {
Expand All @@ -13,7 +13,7 @@
"email": "lala@pycord.dev",
"url": "https://github.com/Lulalaby"
},
"license": "ISC",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Pycord-Development/execute-whitelist-action"
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@ 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({overwrite: true});
} 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({overwrite: true});
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 247dfe0

Please sign in to comment.