Skip to content

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospontual committed Jan 30, 2025
1 parent 90ed9e4 commit f69f468
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Automatically assign reviewers to pull requests using labels.

The standard version of this project works well when executed after label / unlabel GH hooks. However, some projects need the reviewers to be added as part of the PR creation (Open / Re-Open) process (hooks). Thus, if you have on your flow other actions that add labels to the PR and just add the standard GHA to your project, it won't pick up (identify) the labels added during the flow execution.

## Usage

### Add a `.github/assign_label_reviewers.yml` file
Expand Down Expand Up @@ -81,6 +83,7 @@ jobs:
| `unassign-if-label-removed` | Whether to unassign reviewers that belong to a label if the label has been removed | `true` | `true`
| `config-file` | The path to the label configuration file or endpoint that returns JSON configuration file | `false` | `.github/assign_label_reviewers.yml`
| `config-request-headers` | The headers to be passed when calling an endpoint to return the JSON configuration file | `false` | N/A
| `input-labels` | A list of labels that should be used as the input for this action. This is useful when you want to use the action as part of the Github Open / Re-open process, after other actions have already been executed to add labels to the PR. Example of value: '["label","label2","label3"]' | `false` | null

### Action outputs

Expand Down Expand Up @@ -116,6 +119,15 @@ Please note:
}
```

### Using a list of Labels as Input

This fork add the ability to use a list of labels as the input to the action. If a the parameter `input-labels` is provided, then these labels are used as the source to have the reviewers added to the PR.

#### Example of valid input-label:
'["label","label2","label3"]'



#### Example Workflow

```yml
Expand All @@ -138,4 +150,5 @@ jobs:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
config-file: 'https://www.totallymoney.com/assign-reviewers-label-config.json'
config-request-headers: '{"Authorization": "Bearer ${{ secrets.API_TOKEN }}"}'
input-labels: ${{ needs.previousjob.outputs.labels }}
```

0 comments on commit f69f468

Please sign in to comment.