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
The ```github``` config section holds credentials and API endpoint information for accessing the GitHub APIs. Credentials are tied to the instance of GitHub you're using. Whether you're using [github.com](https://github.com) or your own deployment of GitHub Enterprise server, this section is how ```garm``` knows where it should create the runners.
3
+
Starting with version `v0.1.5`, GARM saves github endpoints and github credentials in the database.
4
4
5
-
Tying the API endpoint info to the credentials allows us to use the same ```garm``` installation with both [github.com](https://github.com) and private deployments. All you have to do is to add the needed endpoint info (see bellow).
5
+
<!-- TOC -->
6
+
7
+
-[Configuring github endpoints and credentials](#configuring-github-endpoints-and-credentials)
GARM has the option to use both [Personal Access Tokens (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) or a [GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app).
8
32
@@ -28,55 +52,44 @@ If you plan to use github apps, you'll need to select the following permissions:
28
52
29
53
**Note**:warning:: Github Apps are not available at the enterprise level.
30
54
31
-
The resulting credentials (app or PAT) must be configured in the ```[[github]]``` section of the config. Sample as follows:
32
-
33
-
```toml
34
-
# This is a list of credentials that you can define as part of the repository
35
-
# or organization definitions. They are not saved inside the database, as there
36
-
# is no Vault integration (yet). This will change in the future.
37
-
# Credentials defined here can be listed using the API. Obviously, only the name
38
-
# and descriptions are returned.
39
-
[[github]]
40
-
name = "gabriel"
41
-
description = "github token or user gabriel"
42
-
# This is the type of authentication to use. It can be "pat" or "app"
43
-
auth_type = "pat"
44
-
[github.pat]
45
-
# This is a personal token with access to the repositories and organizations
46
-
# you plan on adding to garm. The "workflow" option needs to be selected in order
47
-
# to work with repositories, and the admin:org needs to be set if you plan on
48
-
# adding an organization.
49
-
oauth2_token = "super secret token"
50
-
[github.app]
51
-
# This is the app_id of the GitHub App that you want to use to authenticate
52
-
# with the GitHub API.
53
-
# This needs to be changed
54
-
app_id = 1
55
-
# This is the private key path of the GitHub App that you want to use to authenticate
All sensitive data is encrypted at rest. The API will not return any sensitive info.
80
+
81
+
## Listing GitHub credentials
82
+
83
+
To list the available GitHub credentials, you can use the following command:
84
+
85
+
```bash
86
+
garm-cli github credentials list
78
87
```
79
88
80
-
The double parenthesis means that this is an array. You can specify the ```[[github]]``` section multiple times, with different tokens from different users, or with different access levels. You will then be able to list the available credentials using the API, and reference these credentials when adding repositories or organizations.
89
+
## Deleting GitHub credentials
90
+
91
+
To delete a GitHub credential, you can use the following command:
81
92
82
-
The API will only ever return the name and description to the API consumer.
0 commit comments