Skip to content

Commit 3336784

Browse files
authored
fix: replace - with _ (#246)
1 parent db3cdf4 commit 3336784

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/get-permissions-from-inputs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export function getPermissionsFromInputs(env) {
1010
if (!key.startsWith("INPUT_PERMISSION-")) return permissions;
1111
if (!value) return permissions;
1212

13-
const permission = key.slice("INPUT_PERMISSION-".length).toLowerCase();
13+
const permission = key.slice("INPUT_PERMISSION-".length).toLowerCase()
14+
.replaceAll(/-/g, "_");
1415

1516
// Inherit app permissions if no permissions inputs are set
1617
if (permissions === undefined) {

tests/snapshots/index.js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Generated by [AVA](https://avajs.dev).
331331
--- REQUESTS ---␊
332332
GET /repos/actions/create-github-app-token/installation␊
333333
POST /app/installations/123456/access_tokens␊
334-
{"repositories":["create-github-app-token"],"permissions":{"issues":"write","pull-requests":"read"}}`
334+
{"repositories":["create-github-app-token"],"permissions":{"issues":"write","pull_requests":"read"}}`
335335

336336
## post-revoke-token-fail-response.test.js
337337

tests/snapshots/index.js.snap

-4 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)