Skip to content

Commit 92d4fc6

Browse files
flaxelC0ZEN
andauthored
📝 Add requested permissions (#492)
* 📝 add requested permissions * 📝 add minor improvement * 📝 add required/recommended perimissions * 📝 fix typo Co-authored-by: Geoffrey Testelin <[email protected]> * 📝 update recommended permissions * 📝 update required permissions * 📝 change permissions * 📝 update recommended permissions * ✏️ remove typo Co-authored-by: Geoffrey Testelin <[email protected]> Co-authored-by: Geoffrey Testelin <[email protected]>
1 parent 1efddcb commit 92d4fc6

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed

README.md

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ The default configuration will:
88
- Close the stale issues and pull requests after 7 days of inactivity
99
- If an update/comment occur on stale issues or pull requests, the stale label will be removed and the timer will restart
1010

11+
## Recommended permissions
12+
13+
For the execution of this action, it must be able to fetch all issues and pull requests from your repository.
14+
This can be achieved with the following [configuration in the action](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions) if the permissions are restricted:
15+
16+
```yaml
17+
permissions:
18+
issues: read
19+
pull-requests: read
20+
```
21+
22+
In addition, based on the provided configuration, the action could require more permission(s) (e.g.: add label, remove label, comment, close, etc.).
23+
You can find more information about the required permissions under the corresponding options that you wish to use.
24+
However, if don't want to bother, you can use these permissions:
25+
26+
```yaml
27+
permissions:
28+
issues: write
29+
pull-requests: write
30+
```
31+
1132
## All options
1233
1334
### List of input options
@@ -159,55 +180,63 @@ The message that will be added as a comment to the issues when the stale workflo
159180

160181
You can skip the comment sending by omitting the option or by passing an empty string.
161182

162-
Default value: unset
183+
Default value: unset
184+
Required Permission: `issues: write`
163185

164186
#### stale-pr-message
165187

166188
The message that will be added as a comment to the pull requests when the stale workflow marks it automatically as stale with a label.
167189

168190
You can skip the comment sending by omitting the option or by passing an empty string.
169191

170-
Default value: unset
192+
Default value: unset
193+
Required Permission: `pull-requests: write`
171194

172195
#### close-issue-message
173196

174197
The message that will be added as a comment to the issues when the stale workflow closes it automatically after being stale for too long.
175198

176-
Default value: unset
199+
Default value: unset
200+
Required Permission: `issues: write`
177201

178202
#### close-pr-message
179203

180204
The message that will be added as a comment to the pull requests when the stale workflow closes it automatically after being stale for too long.
181205

182-
Default value: unset
206+
Default value: unset
207+
Required Permission: `pull-requests: write`
183208

184209
#### stale-issue-label
185210

186211
The label that will be added to the issues when automatically marked as stale.
187212
If you wish to speedup the stale workflow for the issues, you can add this label manually to mark as stale.
188213

189-
Default value: `Stale`
214+
Default value: `Stale`
215+
Required Permission: `issues: write`
190216

191217
#### close-issue-label
192218

193219
The label that will be added to the issues when closed automatically.
194220
It will be automatically removed if the issues are no longer closed nor locked.
195221

196-
Default value: unset
222+
Default value: unset
223+
Required Permission: `issues: write`
197224

198225
#### stale-pr-label
199226

200227
The label that will be added to the pull requests when automatically marked as stale.
201228
If you wish to speedup the stale workflow for the pull requests, you can add this label manually to mark as stale.
202229

203-
Default value: `Stale`
230+
Default value: `Stale`
231+
Required Permission: `pull-requests: write`
204232

205233
#### close-pr-label
206234

207235
The label that will be added to the pull requests when closed automatically.
208236
It will be automatically removed if the pull requests are no longer closed nor locked.
209237

210-
Default value: unset
238+
Default value: unset
239+
Required Permission: `pull-requests: write`
211240

212241
#### exempt-issue-labels
213242

@@ -298,13 +327,15 @@ Default value: `30`
298327

299328
Automatically remove the stale label when the issues or the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`).
300329

301-
Default value: `true`
330+
Default value: `true`
331+
Required Permission: `issues: write` and `pull-requests: write`
302332

303333
#### remove-issue-stale-when-updated
304334

305335
Override [remove-stale-when-updated](#remove-stale-when-updated) but only to automatically remove the stale label when the issues are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`).
306336

307-
Default value: unset
337+
Default value: unset
338+
Required Permission: `issues: write`
308339

309340
#### remove-pr-stale-when-updated
310341

@@ -345,7 +376,8 @@ A comma delimited list of labels to remove when a stale issue or pull request re
345376

346377
Warning: each label results in a unique API call which can drastically consume the limit of [operations-per-run](#operations-per-run).
347378

348-
Default value: unset
379+
Default value: unset
380+
Required Permission: `pull-requests: write`
349381

350382
#### debug-only
351383

@@ -380,7 +412,8 @@ Default value: unset
380412

381413
If set to `true`, the stale workflow will automatically delete the GitHub branches related to the pull requests automatically closed by the stale workflow.
382414

383-
Default value: `false`
415+
Default value: `false`
416+
Required Permission: `pull-requests: write`
384417

385418
#### exempt-milestones
386419

0 commit comments

Comments
 (0)