-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (69 loc) · 2.16 KB
/
governance-consistency.yml
File metadata and controls
80 lines (69 loc) · 2.16 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Governance Consistency Check
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: governance-consistency-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check-consistency:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bash Syntax Check
shell: bash
run: |
set -euo pipefail
failed=0
for f in ops/*.sh; do
if ! bash -n "$f"; then
echo "FAIL: bash -n $f" >&2
failed=1
fi
done
exit "$failed"
- name: Run Onboarding Hard Gate
shell: bash
run: |
set -euo pipefail
./ops/enforce_agent_onboarding_gate.sh
- name: Run Governance Consistency Check
shell: bash
run: |
set -euo pipefail
./ops/check_release_governance_consistency.sh
- name: Task Log Gate Check
shell: bash
run: |
set -euo pipefail
echo "== Checking if non-exempt changes include task logs =="
CHANGED=""
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
CHANGED="$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" || true)"
elif [[ "${{ github.event_name }}" == "push" ]]; then
BEFORE_SHA="${{ github.event.before }}"
AFTER_SHA="${{ github.sha }}"
if [[ -n "$BEFORE_SHA" && ! "$BEFORE_SHA" =~ ^0+$ ]]; then
CHANGED="$(git diff --name-only "$BEFORE_SHA" "$AFTER_SHA" || true)"
else
CHANGED="$(git show --pretty='' --name-only "$AFTER_SHA" || true)"
fi
fi
if [[ -z "$CHANGED" ]]; then
echo "No changed files detected, skip."
exit 0
fi
TASK_LOG_CHECK_FILES="$CHANGED" TASK_LOG_WAIVER=0 TASK_LOG_STRICT=1 ./ops/pre-commit-log-check.sh