-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.18 KB
/
require-codeowners.yml
File metadata and controls
47 lines (40 loc) · 1.18 KB
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
name: Check for CODEOWNERS
on:
# Runs on a pull request for the main branch (we use
# 'pull_request_target' instead of 'pull_request' so
# it also works for forks, since the secrets would
# otherwise not be available for forks).
pull_request_target:
types:
# Default events
- opened
- synchronize
- reopened
# But we also want to make sure a potential
# exception request pull request is getting
# closed if any was open
- closed
branches:
- main
- master
# Runs on a merge group build
merge_group:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: false
jobs:
check:
name: Check for CODEOWNERS
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && ${{ !endsWith(github.actor, '[bot]') }}
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# Find doesn't return non-0 for no results, but grep does.
- name: Check for CODEOWNERS
run: |
find . -iname "CODEOWNERS" | grep .