-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (40 loc) · 1.49 KB
/
assign-random-codeowner.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# THIS CODE WAS AUTOGENERATED. DO NOT MODIFY THIS FILE DIRECTLY
# THE SOURCE CODE LIVES IN A DIFFERENT REPOSITORY:
# - centralized-templates
# FILE STEWARD: @pleo-io/devx,@pleo-bot-auto-approver
name: Assign Random CODEOWNERS
on:
pull_request:
types:
- review_requested
- ready_for_review
- opened
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
assign-codeowners:
name: Assign CODEOWNERS
timeout-minutes: 5
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
# Checkout the repository in order to detect and parse CODEOWNERS
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
# Elevate token permissions to allow assigning people to PRs
- name: Allow assigning reviewers
id: get-assigning-token
uses: peter-murray/workflow-application-token-action@v2
with:
application_id: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_APP_ID }}
application_private_key: ${{ secrets.PLEO_GH_APP_TOKEN_SIGNER_PRIVATE_KEY }}
# Assign random CODEOWNERS unless reviewers have been assigned manually
- name: Assign CODEOWNERS
uses: pleo-io/[email protected]
with:
reviewers-to-assign: 2
assign-from-changed-files: true
assign-individuals-from-teams: true
env:
GITHUB_TOKEN: ${{ steps.get-assigning-token.outputs.token }}