Skip to content

Commit aecbc6a

Browse files
committed
Fail if unknown permissions
1 parent 4805fb6 commit aecbc6a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

advisor/dist/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35237,11 +35237,12 @@ async function run(token, name, count, owner, repo, branch, format) {
3523735237
let summary = core.summary.addHeading(`Minimal required permissions for ${name}:`);
3523835238
log(`Minimal required permissions for ${name}:`);
3523935239

35240-
if (wasUnknown) {
35241-
summary.addRaw("\nAt least one call wasn't recognized. Some permissions are unknown. Check the workflow runs.\n");
35242-
}
35243-
3524435240
try {
35241+
if (wasUnknown) {
35242+
summary.addRaw("\nAt least one call wasn't recognized. Some permissions are unknown. Check the workflow runs.\n");
35243+
throw new Error("At least one call wasn't recognized. Some permissions are unknown. Check the workflow runs.");
35244+
}
35245+
3524535246
if (permissions.size === 0) {
3524635247
summary = summary.addRaw('No permissions logs were found.');
3524735248
throw new Error('No permissions logs were found.');

advisor/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,12 @@ async function run(token, name, count, owner, repo, branch, format) {
118118
let summary = core.summary.addHeading(`Minimal required permissions for ${name}:`);
119119
log(`Minimal required permissions for ${name}:`);
120120

121-
if (wasUnknown) {
122-
summary.addRaw("\nAt least one call wasn't recognized. Some permissions are unknown. Check the workflow runs.\n");
123-
}
124-
125121
try {
122+
if (wasUnknown) {
123+
summary.addRaw("\nAt least one call wasn't recognized. Some permissions are unknown. Check the workflow runs.\n");
124+
throw new Error("At least one call wasn't recognized. Some permissions are unknown. Check the workflow runs.");
125+
}
126+
126127
if (permissions.size === 0) {
127128
summary = summary.addRaw('No permissions logs were found.');
128129
throw new Error('No permissions logs were found.');

0 commit comments

Comments
 (0)