File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
GH_USER_NAME : dsp-developers
13
13
jobs :
14
+ commit_checker :
15
+ name : Run Commit Checker report
16
+ runs-on : ubuntu-latest
17
+ needs : build-pr-images
18
+ steps :
19
+ - name : Get Commits
20
+ id : get-commits
21
+ run : |
22
+ master_commit=$(cat .git/refs/remotes/origin/master)
23
+ echo "master_commit_hash=$master_commit" >> $GITHUB_OUTPUT
24
+ last_commit=$(cat .git/refs/remotes/pull/${{ github.event.pull_request.number }}/merge)
25
+ echo "last_commit_hash=$last_commit" >> $GITHUB_OUTPUT
26
+ - name : Run Commit Checker
27
+ shell : bash
28
+ env :
29
+ GH_TOKEN : ${{ secrets.GH_TOKEN_PROJECT_EDIT }}
30
+ continue-on-error : true
31
+ run : |
32
+ git config user.email "${{ env.GH_USER_EMAIL }}"
33
+ git config user.name "${{ env.GH_USER_NAME }}"
34
+
35
+ cat <<"EOF" >> /tmp/body-file.txt
36
+ Commit Checker results:
37
+ ==== These are the results of the commit checker scans ====
38
+ ==== If these are not commits from upstream kfp, then ====
39
+ ==== please ensure you adhere to the commit checker formatting ====
40
+ $(podman run -q -v ${{ github.workspace }}:/src/app-root quay.io/rmartine/commitchecker:latest --start ${{ steps.get-commits.outputs.master_commit_hash }} --end ${{ steps.get-commits.outputs.last_commit_hash }})
41
+ EOF
42
+
43
+ gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/body-file.txt
14
44
fetch-data :
15
45
name : Fetch workflow payload
16
46
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change
1
+ FROM registry.access.redhat.com/ubi8/go-toolset:1.20 as builder
2
+
3
+ WORKDIR /tmp
4
+ RUN git clone https://github.com/openshift/build-machinery-go.git && \
5
+ cd /tmp/build-machinery-go/commitchecker && \
6
+ go build
7
+
8
+ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9
9
+
10
+ WORKDIR /bin
11
+
12
+ COPY --from=builder /tmp/build-machinery-go/commitchecker/commitchecker /bin/commitchecker
13
+ RUN microdnf install git && \
14
+ chmod +x /bin/commitchecker && \
15
+ mkdir -p /src/app-root
16
+
17
+ WORKDIR /src/app-root
18
+ ENTRYPOINT ["commitchecker" ]
19
+
20
+ VOLUME ["/src/app-root" ]
21
+
22
+ LABEL name="Commit Checker tool" \
23
+ summary="commitchecker validates a range of commits in a git repository and ensures they meet specific requirements: \
24
+ 1. The author's email address does not start with " root@". \
25
+ 2. The message starts with one of: \
26
+ i. UPSTREAM: <PR number|carry|drop>: description \
27
+ ii. UPSTREAM: revert: \
28
+ This is useful for repositories that are downstream forks of upstream repositories."
You can’t perform that action at this time.
0 commit comments