Skip to content

chore: Add Commit Checker github action #33

chore: Add Commit Checker github action

chore: Add Commit Checker github action #33

Workflow file for this run

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: |
# echo "PR_NUMBER=${{ github.event.pull_request.number }}"
# COMMITS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits")
# COMMITS_HASHES=`echo ${COMMITS} | jq -r '.[].sha'`
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
run: |
docker run -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 }}