Repository navigation
51 lines (48 loc) · 1.81 KB
/
Copy pathcommit-check.yml
File metadata and controls
51 lines (48 loc) · 1.81 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
48
49
50
51
name: Commit Check
permissions:
contents: read
on:
pull_request:
branches: 'main'
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
jobs:
commit-check:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # Required for merge-base checks
# Nothing after checkout needs authenticated git.
persist-credentials: false
# The install step must never run a pip.py or venv.py from the
# checkout in place of pip or venv. If it did, these stop the job.
- name: Plant pip.py and venv.py in the workspace
shell: bash
run: |
for name in pip venv; do
echo 'raise SystemExit("a workspace module ran in place of pip or venv")' > "$name.py"
done
- uses: ./ # self test
with:
message: true
branch: true
author-name: true
author-email: true
# Report from the ubuntu job only. Every leg checks the same commits
# against the same rules, so the other two produce a byte-identical
# report — three copies of it on the run page, and the matrix is here
# to prove the action runs on each OS, not to say the same thing
# three times.
job-summary: ${{ matrix.os == 'ubuntu-latest' }}
pr-comments: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' }}
pr-title: true
pr-body-ai-attribution: true
# One leg is enough: all three would try to add the same label.
ai-label: ${{ matrix.os == 'ubuntu-latest' }}