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
Copy file name to clipboardExpand all lines: README.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@
6
6
7
7
This [JavaScript GitHub Action](https://help.github.com/en/actions/building-actions/about-actions#javascript-actions) can be used to act as a GitHub App that with a private key and installation ID to generate a short lived (and optionally de-scoped) token that can be used to authenticate with the GitHub API.
@@ -22,22 +24,23 @@ This [JavaScript GitHub Action](https://help.github.com/en/actions/building-acti
22
24
23
25
This is useful for when `secrets.GITHUB_TOKEN`'s limitations are too restrictive and a personal access token is not suitable.
24
26
25
-
The repo scoped [`secrets.GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) has limitations such as:
27
+
The repo scoped [`secrets.GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token)
28
+
has limitations such as:
26
29
27
30
- Cannot be used to checkout other private or internal repositories.
28
31
- Have their permissions scoped at the workflow level - not by admins.
29
32
- Cannot trigger a workflow run from another workflow.
30
33
31
34
A common workaround for individual use is to use a [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) but this has significant security, maintenance and auditability issues.
32
35
33
-
Github recommends using [GitHub Apps](https://developer.github.com/apps/differences-between-apps/#machine-vs-bot-accounts) as a workaround to automate authentication to Github Services that isn't provided out of the box by Github / Actions.
36
+
Github recommends using [GitHub Apps](https://developer.github.com/apps/differences-between-apps/#machine-vs-bot-accounts) as a
37
+
workaround to automate authentication to Github Services that isn't provided out of the box by Github / Actions.
34
38
35
39
## Example Workflows
36
40
37
41
Get a token with all the permissions of the GitHub Application
38
42
39
43
```yaml
40
-
41
44
jobs:
42
45
get-temp-token:
43
46
runs-on: ubuntu-latest
@@ -46,8 +49,8 @@ jobs:
46
49
id: get_workflow_token
47
50
uses: sammcj/github-app-installation-token@main # or a specific version
- name: Use Application Token to checkout a repository
@@ -157,7 +161,7 @@ The important configuration details for the application are:
157
161
- `Homepage URL`needs to be set to something as long as it is a URL
158
162
- `Expire user authorization tokens`should be checked so as to expire any tokens that are issued
159
163
- `Webhook``Active`checkbox should be unchecked
160
-
- `Repository permissions`, `Organization permissions` and/or `User permissions` should be set to allow the access required for the token that will be issued
164
+
- `Repository permissions`, `Organization permissions` and/or `User permissions` allows the access required for the token that will be issued
161
165
- `Where can this GitHub App be installed?`should be scoped to your desired audience (the current account, or any account)
162
166
163
167
Once the application has been created you will be taken to the `General` settings page for the new application.
@@ -194,7 +198,7 @@ and either:
194
198
195
199
- `GITHUB_ORGANIZATION`- The GitHub Organisation to get the application installation for, if not specified will use the current repository instead
196
200
or
197
-
- `GITHUB_REPOSITORY_OWNER=<user>`- The GitHub Repository Owner to get the application installation for, if not specified will use the current repository instead
201
+
- `GITHUB_REPOSITORY_OWNER`- The GitHub Repository Owner to get the application installation for, if not specified will use the current repository instead
0 commit comments