From a0c5484d59e7d32ccfb416fe8bae8db583b9febb Mon Sep 17 00:00:00 2001 From: Eric Crosson Date: Mon, 26 Dec 2022 15:24:16 -0600 Subject: [PATCH] feat: accept list of reviewers and assignees 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. --- README.md | 27 +++++++++++++++++++++++++++ action.yml | 10 ++++++++++ 2 files changed, 37 insertions(+) diff --git a/README.md b/README.md index dee24b8..56f079f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/action.yml b/action.yml index c562caf..b3c3fde 100644 --- a/action.yml +++ b/action.yml @@ -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 @@ -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 }}