forked from darchr/gem5
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (27 loc) · 1.23 KB
/
change-id.yaml
File metadata and controls
32 lines (27 loc) · 1.23 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
# This workflow runs after a pull-request has been approved by a reviewer.
name: CI Tests
on:
workflow_dispatch:
jobs:
# ensures we have a change-id in every commit, needed for gerrit
check-for-change-id:
# runs on github hosted runner
runs-on: ubuntu-latest
container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
steps:
- uses: actions/github-script@v6
env:
token: "Change-Id"
pattern: ".*"
with:
script: |
const commits = ${{ toJSON(github.event.commits) }}
for (const commit of commits) {
const id = "Change-Id: "
const message = commit.message;
if (!message.includes(id)) {
core.setFailed('One or more of the commits in this pull request is missing a Change-ID, which we require for any changes made to gem5. ' +
'To automatically insert one, run the following:\n f=`git rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; ' +
'curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f\n Then amend the commit with git commit --amend --no-edit, and update your pull request.')
}
}