Skip to content

Commit 877b357

Browse files
committed
fix: declare required permissions
1 parent 0c493aa commit 877b357

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Create a `lock.yml` workflow file in the `.github/workflows` directory,
2323
use one of the [example workflows](#examples) to get started.
2424

2525
### Inputs
26+
27+
<!-- prettier-ignore -->
2628
The action can be configured using [input parameters](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepswith).
2729
All parameters are optional, except `github-token`.
2830

@@ -80,6 +82,7 @@ All parameters are optional, except `github-token`.
8082

8183
### Outputs
8284

85+
<!-- prettier-ignore -->
8386
- **`issues`**
8487
- Issues that have been locked, value is a JSON string in the form
8588
of `[{"owner": "actions", "repo": "toolkit", "issue_number": 1}]`
@@ -94,15 +97,20 @@ All parameters are optional, except `github-token`.
9497
The following workflow will search once an hour for closed issues
9598
and pull requests that can be locked.
9699

100+
<!-- prettier-ignore -->
97101
```yaml
98102
name: 'Lock Threads'
99103

100104
on:
101105
schedule:
102106
- cron: '0 * * * *'
103107

108+
permissions:
109+
issues: write
110+
pull-requests: write
111+
104112
jobs:
105-
lock:
113+
action:
106114
runs-on: ubuntu-latest
107115
steps:
108116
- uses: dessant/lock-threads@v2
@@ -114,6 +122,7 @@ Edit the workflow after the initial backlog of issues and pull requests
114122
has been processed to reduce the frequency of scheduled runs.
115123
Running the workflow only once a day helps reduce resource usage.
116124
125+
<!-- prettier-ignore -->
117126
```yaml
118127
on:
119128
schedule:
@@ -126,15 +135,20 @@ This workflow declares all the available input parameters of the action
126135
and their default values. Any of the parameters can be omitted,
127136
except `github-token`.
128137

138+
<!-- prettier-ignore -->
129139
```yaml
130140
name: 'Lock Threads'
131141
132142
on:
133143
schedule:
134144
- cron: '0 0 * * *'
135145
146+
permissions:
147+
issues: write
148+
pull-requests: write
149+
136150
jobs:
137-
lock:
151+
action:
138152
runs-on: ubuntu-latest
139153
steps:
140154
- uses: dessant/lock-threads@v2
@@ -160,6 +174,7 @@ jobs:
160174
This step will lock only issues, and exclude issues created before 2018,
161175
or those with the `upstream` or `help-wanted` labels applied.
162176

177+
<!-- prettier-ignore -->
163178
```yaml
164179
steps:
165180
- uses: dessant/lock-threads@v2
@@ -173,6 +188,7 @@ or those with the `upstream` or `help-wanted` labels applied.
173188
This step will lock only pull requests, and exclude those
174189
with the `wip` label applied.
175190

191+
<!-- prettier-ignore -->
176192
```yaml
177193
steps:
178194
- uses: dessant/lock-threads@v2
@@ -187,6 +203,7 @@ with the `wip` label applied.
187203
This step will post a comment on issues and pull requests before locking them,
188204
and apply the `outdated` label to issues.
189205

206+
<!-- prettier-ignore -->
190207
```yaml
191208
steps:
192209
- uses: dessant/lock-threads@v2

0 commit comments

Comments
 (0)