Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
get parent commit from gh
  • Loading branch information
norihiro committed Aug 7, 2025
commit 18155854fbe1d1f0d5ccb82f97fa443284af92d9
8 changes: 5 additions & 3 deletions .github/actions/commit-message-validator/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ runs:

- name: Fetch commits from GitHub
shell: bash
id: gh
working-directory: ${{ inputs.workingDirectory }}
run: |
: Run log message checker
gh api repos/${{ github.repository }}/pulls/${{ github.event.number }}/commits > commits.json
: Fetch commits from GitHub
parent_commit="$(gh api repos/${{ github.repository }}/pulls/${{ github.event.number }}/commits | jq -r '.[0].parents[0].sha')"
echo "parent_commit=${parent_commit}" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}

Expand All @@ -45,7 +47,7 @@ runs:
BODY_IGNORE_LINE_RE='\(^Co-Authored-By:\|\<https\?://\)'
BODY_EXCEED_LIMIT_RE='.\{73\}'

COMMIT_RANGE=master..
COMMIT_RANGE="${{ steps.gh.outputs.parent_commit }}.."

exit_code=0
export LC_ALL=C LC_CTYPE=C LANG=C
Expand Down
Loading