Skip to content

Commit

Permalink
fix: declare required permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Jul 4, 2021
1 parent 0c493aa commit 877b357
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Create a `lock.yml` workflow file in the `.github/workflows` directory,
use one of the [example workflows](#examples) to get started.

### Inputs

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

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

### Outputs

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

<!-- prettier-ignore -->
```yaml
name: 'Lock Threads'

on:
schedule:
- cron: '0 * * * *'

permissions:
issues: write
pull-requests: write

jobs:
lock:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
Expand All @@ -114,6 +122,7 @@ Edit the workflow after the initial backlog of issues and pull requests
has been processed to reduce the frequency of scheduled runs.
Running the workflow only once a day helps reduce resource usage.
<!-- prettier-ignore -->
```yaml
on:
schedule:
Expand All @@ -126,15 +135,20 @@ This workflow declares all the available input parameters of the action
and their default values. Any of the parameters can be omitted,
except `github-token`.

<!-- prettier-ignore -->
```yaml
name: 'Lock Threads'
on:
schedule:
- cron: '0 0 * * *'
permissions:
issues: write
pull-requests: write
jobs:
lock:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
Expand All @@ -160,6 +174,7 @@ jobs:
This step will lock only issues, and exclude issues created before 2018,
or those with the `upstream` or `help-wanted` labels applied.

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

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

<!-- prettier-ignore -->
```yaml
steps:
- uses: dessant/lock-threads@v2
Expand Down

0 comments on commit 877b357

Please sign in to comment.