You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use core.getBooleanInput() to retrieve boolean input values (#223)
This PR switches from evaluating values passed to `skip-token-revoke` as
true if they are truthy in JavaScript, to using `getBooleanInput`. This
change ensures that only proper YAML boolean values are recognized,
preventing unintended evaluations to true.
- The definition of `getBooleanInput` is here: definition of
`core#getBooealnInput` is here:
https://github.com/actions/toolkit/blob/930c89072712a3aac52d74b23338f00bb0cfcb24/packages/core/src/core.ts#L188-L208
The documentation states, `"If truthy, the token will not be revoked
when the current job is complete"`, so this change could be considered a
breaking change. This means that if there are users who rely on `truthy`
and expect values like whitespace or `"false"` to be evaluated as true
(though this is likely rare), it would be a breaking change.
- `Boolean(" ")` and `Boolean("false")` are both evaluated as true.
Alternatively, it can simply be considered a fix. How to handle this is
up to the maintainer.
Resolves#216
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -343,7 +343,7 @@ The reason we define one `permision-<permission name>` input per permission is t
343
343
344
344
### `skip-token-revoke`
345
345
346
-
**Optional:** If truthy, the token will not be revoked when the current job is complete.
346
+
**Optional:** If true, the token will not be revoked when the current job is complete.
347
347
348
348
### `github-api-url`
349
349
@@ -370,7 +370,7 @@ The action creates an installation access token using [the `POST /app/installati
370
370
1. The token is scoped to the current repository or `repositories` if set.
371
371
2. The token inherits all the installation's permissions.
372
372
3. The token is set as output `token` which can be used in subsequent steps.
373
-
4. Unless the `skip-token-revoke` input is set to a truthy value, the token is revoked in the `post` step of the action, which means it cannot be passed to another job.
373
+
4. Unless the `skip-token-revoke` input is set to true, the token is revoked in the `post` step of the action, which means it cannot be passed to another job.
374
374
5. The token is masked, it cannot be logged accidentally.
0 commit comments