constellation/.github/workflows/assign_reviewer.yml
2024-05-14 10:02:00 +02:00

31 lines
916 B
YAML

name: Assign Reviewer
on:
pull_request:
types: ["labeled"]
permissions:
pull-requests: write
jobs:
assign_reviewer:
runs-on: ubuntu-latest
if: github.event.label.name == 'dependencies' && github.event.pull_request.user.login == 'app/renovate'
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Pick assignee
id: pick-assignee
uses: ./.github/actions/pick_assignee
- name: Assign reviewer
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
ASSIGNEE: ${{ steps.pick-assignee.outputs.assignee }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/edgelesssys/constellation/pulls/${PR}/requested_reviewers" \
-f "reviewers[]=${ASSIGNEE}"