Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 12bd25a9 authored by Corey Bryant's avatar Corey Bryant Committed by GitHub
Browse files

Merge pull request #9361 from kewisch/auto-assign

chore: Automatically assign reviewer to pull request
parents 73167d3b dcd832d2
Loading
Loading
Loading
Loading
+30 −0
Original line number Original line Diff line number Diff line
---
name: Auto Assign Reviewer

# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
on:
  pull_request_target:
    types: [review_requested]

jobs:
  assign-reviewer:
    runs-on: ubuntu-latest
    environment: botmobile
    steps:
      - name: App token generate
        uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e  # v2.0.6
        if: ${{ vars.BOT_CLIENT_ID }}
        id: app-token
        with:
          app-id: ${{ vars.BOT_CLIENT_ID }}
          private-key: ${{ secrets.BOT_PRIVATE_KEY }}

      - name: Assign reviewer to PR
        if: ${{ github.event.requested_reviewer }}
        env:
          PR_REVIEWER: ${{ github.event.requested_reviewer.login }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
          GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
        run: |
          gh pr edit $PR_NUMBER --repo $GITHUB_REPOSITORY --add-assignee "$PR_REVIEWER"