Skip to content

Commit c7ca9b5

Browse files
authored
Merge pull request #677 from github/lcartey/fix-check-permission
Fix input passing in check-permissions
2 parents cf4e3ca + 122a8f7 commit c7ca9b5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/actions/check-permissions/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ runs:
1616
steps:
1717
- uses: actions/github-script@v7
1818
id: check-permission
19+
env:
20+
INPUT_MINIMUM-PERMISSION: ${{ inputs.minimum-permission }}
1921
with:
2022
script: |
2123
// Valid permissions are none, read, write, admin (legacy base permissions)
2224
const permissionsRanking = ["none", "read", "write", "admin"];
2325
26+
// Note: core.getInput doesn't work by default in a composite action - in this case
27+
// it would try to fetch the input to the github-script instead of the action
28+
// itself. Instead, we set the appropriate magic env var with the actions input.
29+
// See: https://github.com/actions/runner/issues/665
2430
const minimumPermission = core.getInput('minimum-permission');
2531
if (!permissionsRanking.includes(minimumPermission)) {
2632
core.setFailed(`Invalid minimum permission: ${minimumPermission}`);
@@ -40,4 +46,4 @@ runs:
4046
core.info(`Current actor (${tools.context.actor}) does not have the minimum required permission '${minimumPermission}' (has '${actorPermission}')`);
4147
} else {
4248
core.info(`Current actor (${tools.context.actor}) has the minimum required permission '${minimumPermission}' (has '${actorPermission}')`);
43-
}
49+
}

0 commit comments

Comments
 (0)