Repository navigation
55 lines (50 loc) · 2.02 KB
/
Copy pathpull-request.yml
File metadata and controls
55 lines (50 loc) · 2.02 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
52
53
54
55
# SPDX-FileCopyrightText: 2026 The Gatepost authors
# SPDX-License-Identifier: Apache-2.0
name: pull request
# A squash merge puts the title and the body of the pull request on main as the commit message.
# An edit of the title or the body does not push a commit, so it must start these jobs again.
on:
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
concurrency:
group: pull-request-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
sign-off:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The check reads each commit from the base to the head.
fetch-depth: 0
submodules: true
persist-credentials: false
# Only the message that reaches main gets the other message rules, so a commit needs a
# sign-off and nothing more.
- name: Check that each commit has a sign-off
env:
BASE: ${{ github.event.pull_request.base.sha }}
HEAD: ${{ github.event.pull_request.head.sha }}
run: python3 spec/scripts/check-tells --signed-off "$BASE..$HEAD"
squash-message:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
persist-credentials: false
# The title and the body come through env, so that no text of the pull request ends up
# inside the script.
- name: Check the message that the squash merge puts on main
env:
TITLE: ${{ github.event.pull_request.title }}
NUMBER: ${{ github.event.pull_request.number }}
BODY: ${{ github.event.pull_request.body }}
run: |
printf '%s (#%s)\n\n%s\n' "$TITLE" "$NUMBER" "$BODY" > "$RUNNER_TEMP/message"
python3 spec/scripts/check-tells --squash-msg "$RUNNER_TEMP/message"
scripts/check-commit-msg "$RUNNER_TEMP/message"