forked from kubeflow/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 11
44 lines (42 loc) · 1.82 KB
/
commit-checker.yaml
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
name: Unit Tests
on:
pull_request:
types:
- opened
- reopened
- closed
- synchronize
workflow_dispatch:
env:
RESOURCES_DIR: ${{ github.workspace }}/.github/resources
GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_EDIT }}
GH_USER_EMAIL: [email protected]
GH_USER_NAME: dsp-developers
jobs:
commit_checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Commits
id: get-commits
run: |
master_commit=$(cat .git/refs/remotes/origin/master)
echo "master_commit_hash=$master_commit" >> $GITHUB_OUTPUT
last_commit=$(cat .git/refs/remotes/pull/36/merge)
echo "last_commit_hash=$last_commit" >> $GITHUB_OUTPUT
- name: Run Commit Checker
continue-on-error: true
run: |
git config user.email "${{ env.GH_USER_EMAIL }}"
git config user.name "${{ env.GH_USER_NAME }}"
cat <<"EOF" >> /tmp/body-file.txt
::group::Commit Checker results
::warning ::==== These are the results of the commit checker scans ====
::warning ::==== If these are not commits from upstream kfp, then ====
::warning ::==== please ensure you adhere to the commit checker formatting ====
$(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 }})
::endgroup::
EOF
gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/body-file.txt