Skip to content

Commit

Permalink
Set default value for repo-token (#32)
Browse files Browse the repository at this point in the history
* Set default value for `repo-token`

* Add "Use your token" to README

* Use v1.3.2

* Add pull-requests: write permission

* Add contents: read permission

* Revoke contents: read
  • Loading branch information
toshimaru committed May 16, 2021
1 parent 7d6cc51 commit 0678040
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
@@ -1,5 +1,7 @@
name: 'Auto Author Assign'
on: [pull_request_target]
permissions:
pull-requests: write
jobs:
assign-author:
runs-on: ubuntu-latest
Expand All @@ -8,5 +10,3 @@ jobs:
uses: actions/checkout@v2
- name: Test toshimaru/auto-author-assign action
uses: ./ # Uses an action in the root directory
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
20 changes: 17 additions & 3 deletions README.md
Expand Up @@ -14,7 +14,7 @@ This action automatically assigns PR author as an assignee.

## Usage

```yaml
```yml
# .github/workflows/auto-author-assign.yml
name: 'Auto Author Assign'

Expand All @@ -30,11 +30,25 @@ jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v1.3.0
- uses: toshimaru/auto-author-assign@v1.3.2
```

## Use your token

You can specify your own token.

```yml
jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: "${{ secrets.YOUR_TOKEN }}"
```

If not specified, `GITHUB_TOKEN` will be used by default.

## Skip assigning author

`auto-author-assign` action skips assigning the author when:
Expand Down
1 change: 1 addition & 0 deletions action.yml
Expand Up @@ -5,6 +5,7 @@ inputs:
repo-token:
description: 'A token for the repository'
required: true
default: '${{ github.token }}'
runs:
using: 'node12'
main: 'dist/index.js'
Expand Down

0 comments on commit 0678040

Please sign in to comment.