diff --git a/dist/index.js b/dist/index.js index b6461c5..0971526 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29258,8 +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(); } 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(); 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`); } } diff --git a/package-lock.json b/package-lock.json index 56fde9a..de7cd15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "execute-whitelist-action", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "execute-whitelist-action", - "version": "1.0.5", + "version": "1.0.6", "license": "ISC", "dependencies": { "@actions/core": "1.10.1", diff --git a/package.json b/package.json index 42dec6a..f3a6ba2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "execute-whitelist-action", - "version": "1.0.6", + "version": "1.0.7", "description": "Action to whitelist executions", "main": "index.ts", "scripts": { diff --git a/src/index.ts b/src/index.ts index a4f2a7c..757b1c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,7 +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() } 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) {