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
+40-2Lines changed: 40 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Then just use the formatter and it will report errors and warnings on PRs!
31
31
eslint --format github file.js
32
32
```
33
33
34
-
## Using you own GitHub App
34
+
## Using you own GitHub App (recommended)
35
35
36
36
You might not want to use our github app for the formatter.
37
37
@@ -52,6 +52,11 @@ Go to [this page](https://github.com/settings/apps) to create a new GitHub app.
52
52
53
53
Then hit `Save Changes` and you're all done setting up your GitHub app.
54
54
55
+
You need to configure Permissions for your GitHub app. You need to set the following permissions:
56
+
57
+
-`Checks` - `Read & Write`
58
+
-`Metadata` - `Read-only`
59
+
55
60
### 2. Set `ESLINT_APP_ID` environment variable
56
61
57
62
Your GitHub application's ID. This can be found at the top of your GitHub app's edit page.
@@ -62,10 +67,43 @@ The private RSA key for your application. The prompt to generate the RSA key is
62
67
63
68
Once you have generated a key, open the file that is downloaded and copy to text into the `PRIVATE_KEY` environment variable.
64
69
70
+
When using GitHub Actions, you can use the environment variable `ESLINT_PRIVATE_KEY_BASE64` to set the private key base64 encoded.
71
+
This fix the issue with the new line characters in the private key.
72
+
73
+
To encode the private key, you can use the following command:
74
+
75
+
```sh
76
+
cat private-key.pem | base64
77
+
```
78
+
65
79
### 4. Set `GH_API` (enterprise only)
66
80
67
81
To get this package to work on github enterprise instances you will need to set the `GH_API` environment variable to a url pointing towards your enterprise GitHub's API.
68
82
69
83
### 5. (optional) Set `GH_CHECK_NAME`
70
84
71
-
If the default check name conflicts with something, you can override it by passing `GH_CHECK_NAME` environment variable.
85
+
If the default check name conflicts with something, you can override it by passing `GH_CHECK_NAME` environment variable.
86
+
87
+
### Example for GitHub Actions
88
+
89
+
> **Warning**
90
+
> It is strongly recommended to create your own GitHub app and never share your private key with third parties.
91
+
> Otherwise, unauthorized persons can read meta data and manipulate checks.
0 commit comments