-
Notifications
You must be signed in to change notification settings - Fork 416
42 lines (39 loc) · 1.25 KB
/
codeowners.yml
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
name: Codeowners
on:
pull_request:
jobs:
report_codeowners:
name: "Report codeowners"
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- name: Setup go
uses: actions/setup-go@v5
- name: Install codeowners
run: go install github.com/hmarr/codeowners/cmd/codeowners@latest
- name: List owners of all changed files
id: codeowners_resolved
run: |
codeowners ${{ steps.changed-files.outputs.all_changed_files }}
echo "results<<EOF" >> "$GITHUB_OUTPUT"
echo "$(codeowners ${{ steps.changed-files.outputs.all_changed_files }})" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
filePath: resolved.txt
comment_tag: codeowners_resolved
mode: upsert
message: |
`CODEOWNERS` have been resolved as:
```
${{ steps.codeowners_resolved.outputs.results }}
```