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
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,10 +55,6 @@ jobs:
55
55
56
56
- name: Compress PR Images
57
57
uses: calibreapp/image-actions@main
58
-
with:
59
-
# `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories.
60
-
# See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions
61
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62
58
```
63
59
64
60
2. Open a Pull Request with new or updated imagery. Image Actions will optimise images, and commit them to your branch:
@@ -153,7 +149,6 @@ jobs:
153
149
id: calibre
154
150
uses: calibreapp/image-actions@main
155
151
with:
156
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157
152
compressOnly: true
158
153
- name: Create New Pull Request If Needed
159
154
if: steps.calibre.outputs.markdown != ''
@@ -171,6 +166,15 @@ By default, GitHub Actions do not have permission to alter forked repositories.
171
166
172
167
1. **Replace the default `GITHUB_TOKEN` with a [Personal Access Token (PAT)](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token) which does have permission to access forked repositories.** Be aware that this introduces potential security concerns (which is why it not available by default).
173
168
169
+
```yml
170
+
- name: Compress PR Images
171
+
uses: calibreapp/image-actions@main
172
+
with:
173
+
# `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories.
174
+
# See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions
175
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176
+
```
177
+
174
178
2. **Run Image Actions only for Pull Requests in the current repository.** This approach is advised when not using Personal Access Tokens (PATs) to avoid wasting time and compute for compressions that will not be committed. Use the following configuration to check if a Pull Request belongs to the repository:
175
179
176
180
```yml
@@ -202,7 +206,6 @@ jobs:
202
206
id: calibre
203
207
uses: calibreapp/image-actions@main
204
208
with:
205
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
206
209
compressOnly: true
207
210
- name: Create New Pull Request If Needed
208
211
if: steps.calibre.outputs.markdown != ''
@@ -265,7 +268,6 @@ jobs:
265
268
id: calibre
266
269
uses: calibreapp/image-actions@main
267
270
with:
268
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
269
271
# For non-Pull Requests, run in compressOnly mode and we'll PR after.
0 commit comments