Skip to content

Commit

Permalink
fix: Rename input, from 'skip-token-revoke' to 'skip_token_revoke'
Browse files Browse the repository at this point in the history
  • Loading branch information
smockle committed Oct 5, 2023
1 parent 02443a1 commit 5a2e1e7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
> [!NOTE]
> If `owner` is set and `repositories` is empty, access will be scoped to all repositories in the provided repository owner's installation. If `owner` and `repositories` are empty, access will be scoped to only the current repository.

### `skip-token-revoke`
### `skip_token_revoke`

**Optional:** If truthy, the token will not be revoked when the current job is complete.

Expand All @@ -162,7 +162,7 @@ The action creates an installation access token using [the `POST /app/installati
1. The token is scoped to the current repository or `repositories` if set.
2. The token inherits all the installation's permissions.
3. The token is set as output `token` which can be used in subsequent steps.
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.
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.
5. The token is masked, it cannot be logged accidentally.

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
repositories:
description: "Repositories to install the GitHub App on (defaults to current repository if owner is unset)"
required: false
skip-token-revoke:
skip_token_revoke:
description: "If truthy, the token will not be revoked when the current job is complete"
required: false
outputs:
Expand Down
2 changes: 1 addition & 1 deletion dist/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10107,7 +10107,7 @@ var appId = import_core.default.getInput("app_id");
var privateKey = import_core.default.getInput("private_key");
var owner = import_core.default.getInput("owner");
var repositories = import_core.default.getInput("repositories");
var skipTokenRevoke = Boolean(import_core.default.getInput("skip-token-revoke"));
var skipTokenRevoke = Boolean(import_core.default.getInput("skip_token_revoke"));
main(
appId,
privateKey,
Expand Down
2 changes: 1 addition & 1 deletion dist/post.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2973,7 +2973,7 @@ var import_core = __toESM(require_core(), 1);

// lib/post.js
async function post(core2, request2) {
const skipTokenRevoke = Boolean(core2.getInput("skip-token-revoke"));
const skipTokenRevoke = Boolean(core2.getInput("skip_token_revoke"));
if (skipTokenRevoke) {
core2.info("Token revocation was skipped");
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @param {import("@octokit/request").request} request
*/
export async function post(core, request) {
const skipTokenRevoke = Boolean(core.getInput("skip-token-revoke"));
const skipTokenRevoke = Boolean(core.getInput("skip_token_revoke"));

if (skipTokenRevoke) {
core.info("Token revocation was skipped");
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const privateKey = core.getInput("private_key");
const owner = core.getInput("owner");
const repositories = core.getInput("repositories");

const skipTokenRevoke = Boolean(core.getInput("skip-token-revoke"));
const skipTokenRevoke = Boolean(core.getInput("skip_token_revoke"));

main(
appId,
Expand Down
2 changes: 1 addition & 1 deletion tests/post-token-skipped.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ process.env.STATE_token = "secret123";

// inputs are set as environment variables with the prefix INPUT_
// https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
process.env["INPUT_SKIP-TOKEN-REVOKE"] = "true";
process.env.INPUT_SKIP_TOKEN_REVOKE = "true";

const mockAgent = new MockAgent();

Expand Down

0 comments on commit 5a2e1e7

Please sign in to comment.