Skip to content

Commit

Permalink
Add option to not revoke token
Browse files Browse the repository at this point in the history
  • Loading branch information
tibdex committed Sep 19, 2023
1 parent 9571738 commit b672cdc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
# repositories: >-
# ["actions/toolkit", "github/docs"]

# Optional.
# revoke: "false"

- run: "echo 'The created token is masked: ${{ steps.create_token.outputs.token }}'"
```
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ inputs:
The JSON-stringified array of the full names of the repositories the token should have access to.
Defaults to all repositories that the installation can access.
See https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app's `repositories`.
revoke:
description: Revoke the token at the end of the job.
default: "true"
outputs:
token:
description: An installation access token for the GitHub App.
runs:
using: node20
main: dist/main/index.js
post: dist/post/index.js
post-if: fromJson(github.event.inputs.revoke)
branding:
icon: unlock
color: gray-dark
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-app-token",
"version": "2.0.0",
"version": "2.1.0",
"license": "MIT",
"type": "module",
"files": [
Expand All @@ -16,7 +16,7 @@
"typecheck": "tsc --build"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/core": "^1.10.1",
"@actions/github": "^5.1.1",
"@octokit/auth-app": "^6.0.0",
"@octokit/request": "^8.1.1",
Expand All @@ -25,7 +25,7 @@
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/is-base64": "^1.1.1",
"@types/node": "^20.6.0",
"@types/node": "^20.6.2",
"@vercel/ncc": "^0.38.0",
"prettier": "^3.0.3",
"prettier-plugin-packagejson": "^2.4.5",
Expand Down

0 comments on commit b672cdc

Please sign in to comment.