ci: wire governance traceability env in gitea workflow and guard zero SHA (#330)
Some checks failed
Gitea CI / test (push) Failing after 3s
Gitea CI / test (pull_request) Failing after 3s

This commit is contained in:
agentson
2026-03-01 10:06:25 +09:00
parent c31ee37f13
commit e9de950bec
2 changed files with 7 additions and 2 deletions

View File

@@ -28,6 +28,9 @@ jobs:
run: python3 scripts/session_handover_check.py --strict run: python3 scripts/session_handover_check.py --strict
- name: Validate governance assets - name: Validate governance assets
env:
GOVERNANCE_PR_TITLE: ${{ github.event.pull_request.title }}
GOVERNANCE_PR_BODY: ${{ github.event.pull_request.body }}
run: | run: |
RANGE="" RANGE=""
if [ "${{ github.event_name }}" = "pull_request" ] && [ -n "${{ github.event.pull_request.base.sha }}" ]; then if [ "${{ github.event_name }}" = "pull_request" ] && [ -n "${{ github.event.pull_request.base.sha }}" ]; then

View File

@@ -29,11 +29,13 @@ jobs:
GOVERNANCE_PR_TITLE: ${{ github.event.pull_request.title }} GOVERNANCE_PR_TITLE: ${{ github.event.pull_request.title }}
GOVERNANCE_PR_BODY: ${{ github.event.pull_request.body }} GOVERNANCE_PR_BODY: ${{ github.event.pull_request.body }}
run: | run: |
RANGE=""
if [ "${{ github.event_name }}" = "pull_request" ]; then if [ "${{ github.event_name }}" = "pull_request" ]; then
RANGE="${{ github.event.pull_request.base.sha }}...${{ github.sha }}" RANGE="${{ github.event.pull_request.base.sha }}...${{ github.sha }}"
python3 scripts/validate_governance_assets.py "$RANGE" elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
elif [ "${{ github.event_name }}" = "push" ]; then
RANGE="${{ github.event.before }}...${{ github.sha }}" RANGE="${{ github.event.before }}...${{ github.sha }}"
fi
if [ -n "$RANGE" ]; then
python3 scripts/validate_governance_assets.py "$RANGE" python3 scripts/validate_governance_assets.py "$RANGE"
else else
python3 scripts/validate_governance_assets.py python3 scripts/validate_governance_assets.py