Skip to content

Commit

Permalink
feat: accept list of reviewers and assignees
Browse files Browse the repository at this point in the history
Pass a list of GitHub usernames through to
peter-evans/create-pull-request.

Assignees are specified with the `pr-assignees` property.
Reviewers are specified with the `pr-reviewers` property.

Both properties expect the value to be a list of GitHub usernames,
separated by either commas or newlines.
  • Loading branch information
EricCrosson authored and cole-h committed Jan 19, 2023
1 parent aa092a7 commit a0c5484
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,33 @@ However you can customize it, with variable interpolation performed with [Handle
- env.GIT_COMMITTER_EMAIL
- env.GIT_COMMIT_MESSAGE
## Add assignees or reviewers
You can assign the PR to or request a review from one or more GitHub users with `pr-assignees` and `pr-reviewers`, respectively.
These properties expect a comma or newline separated list of GitHub usernames:
```yaml
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 1,4' # Run twice a week
jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v16
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@vX
with:
pr-assignees: SomeGitHubUsername
pr-reviewers: SomeOtherGitHubUsername,SomeThirdGitHubUsername
```
## Contributing
Feel free to send a PR or open an issue if you find something functions unexpectedly! Please make sure to test your changes and update any related documentation before submitting your PR.
Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ inputs:
description: 'A comma or newline separated list of labels to set on the Pull Request to be created'
required: false
default: ''
pr-assignees:
description: 'A comma or newline separated list of assignees (GitHub usernames).'
required: false
default: ''
pr-reviewers:
description: 'A comma or newline separated list of reviewers (GitHub usernames) to request a review from.'
required: false
default: ''
git-author-name:
description: 'Author name used for commit. Only used if sign-commits is false.'
required: false
Expand Down Expand Up @@ -176,5 +184,7 @@ runs:
author: ${{ env.GIT_AUTHOR_NAME }} ${{ env.GIT_AUTHOR_EMAIL }}
title: ${{ inputs.pr-title }}
token: ${{ inputs.token }}
assignees: ${{ inputs.pr-assignees }}
labels: ${{ inputs.pr-labels }}
reviewers: ${{ inputs.pr-reviewers }}
body: ${{ steps.pr_body.outputs.contents }}

0 comments on commit a0c5484

Please sign in to comment.