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
{{ message }}
This repository was archived by the owner on Jul 7, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,33 +18,32 @@ jobs:
18
18
job:
19
19
runs-on: ubuntu-latest
20
20
steps:
21
-
- name: Generate token
22
-
id: generate_token
23
-
uses: tibdex/github-app-token@v1
21
+
- id: create_token
22
+
uses: tibdex/github-app-token@v2
24
23
with:
25
24
app_id: ${{ secrets.APP_ID }}
26
25
27
26
# Optional.
28
27
# github_api_url: https://api.example.com
29
28
30
29
# Optional.
31
-
# installation_id: 1337
30
+
# installation_retrieval_mode: id
31
+
32
+
# Optional.
33
+
# installation_retrieval_payload: 1337
32
34
33
35
# Optional.
34
36
# Using a YAML multiline string to avoid escaping the JSON quotes.
35
37
# permissions: >-
36
-
# {"members": "read"}
38
+
# {"pull_requests": "read"}
37
39
38
40
private_key: ${{ secrets.PRIVATE_KEY }}
39
41
40
42
# Optional.
41
-
# repository: owner/repo
43
+
# repositories: >-
44
+
# ["actions/toolkit", "github/docs"]
42
45
43
-
- name: Use token
44
-
env:
45
-
TOKEN: ${{ steps.generate_token.outputs.token }}
46
-
run: |
47
-
echo "The generated token is masked: ${TOKEN}"
46
+
- run: "echo 'The created token is masked: ${{ steps.create_token.outputs.token }}'"
48
47
```
49
48
50
49
[Another use case for this action can (or could) be found in GitHub's own docs](https://web.archive.org/web/20230115194214/https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions#example-workflow-authenticating-with-a-github-app).
Copy file name to clipboardExpand all lines: action.yml
+32-8Lines changed: 32 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,49 @@ inputs:
5
5
app_id:
6
6
description: ID of the GitHub App.
7
7
required: true
8
-
installation_id:
9
-
description: The ID of the installation for which the token will be requested (defaults to the ID of the repository's installation).
10
8
github_api_url:
11
9
description: The API URL of the GitHub server.
12
10
default: ${{ github.api_url }}
11
+
installation_retrieval_mode:
12
+
description: >-
13
+
The mode used to retrieve the installation for which the token will be requested.
14
+
15
+
One of:
16
+
- id: use the installation with the specified ID.
17
+
- organization: use an organization installation (https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-an-organization-installation-for-the-authenticated-app).
18
+
- repository: use a repository installation (https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app).
19
+
- user: use a user installation (https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app).
20
+
default: repository
21
+
installation_retrieval_payload:
22
+
description: >-
23
+
The payload used to retrieve the installation.
24
+
25
+
Examples for each retrieval mode:
26
+
- id: 1337
27
+
- organization: github
28
+
- repository: tibdex/github-app-token
29
+
- user: tibdex
30
+
default: ${{ github.repository }}
13
31
permissions:
14
-
description: The JSON-stringified permissions granted to the token (defaults to all the GitHub app permissions, see https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app).
32
+
description: >-
33
+
The JSON-stringified permissions granted to the token.
34
+
Defaults to all permissions granted to the GitHub app.
35
+
See https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app's `permissions`.
15
36
private_key:
16
37
description: Private key of the GitHub App (can be Base64 encoded).
17
38
required: true
18
-
repository:
19
-
description: The full name of the repository for which the token will be requested.
20
-
default: ${{ github.repository }}
39
+
repositories:
40
+
description: >-
41
+
The JSON-stringified array of the full names of the repositories the token should have access to.
42
+
Defaults to all repositories that the installation can access.
43
+
See https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app's `repositories`.
21
44
outputs:
22
45
token:
23
-
description: An installation token for the GitHub App on the requested repository.
46
+
description: An installation access token for the GitHub App.
0 commit comments