chore: Add Commit Checker github action #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- closed | |
- synchronize | |
workflow_dispatch: | |
env: | |
RESOURCES_DIR: ${{ github.workspace }}/.github/resources | |
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: | | |
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.txt |