forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 234
55 lines (50 loc) · 1.64 KB
/
Copy pathagent_governance.yml
File metadata and controls
55 lines (50 loc) · 1.64 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
name: Agent Governance
on:
pull_request:
types: [opened, synchronize, reopened, edited, ready_for_review]
permissions:
contents: read
pull-requests: read
jobs:
governance:
name: Governance checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run ABACUS governance checker
id: governance
run: |
set +e
base_sha="${{ github.event.pull_request.base.sha }}"
head_sha="${{ github.event.pull_request.head.sha }}"
merge_base="$(git merge-base "$base_sha" "$head_sha")"
merge_base_status=$?
if [ "$merge_base_status" -ne 0 ]; then
{
echo "## Agent Governance Check"
echo
echo "Failed to compute the pull request merge base."
} > agent_governance_summary.md
exit "$merge_base_status"
fi
python3 tools/03_code_analysis/agent_governance_check.py \
--base "$merge_base" \
--head "$head_sha" \
--event-path "$GITHUB_EVENT_PATH" \
--format markdown | tee agent_governance_summary.md
status=${PIPESTATUS[0]}
if [ ! -s agent_governance_summary.md ]; then
{
echo "## Agent Governance Check"
echo
echo "Checker failed before producing a summary."
} > agent_governance_summary.md
fi
exit "$status"
- name: Publish governance summary
if: always()
run: |
cat agent_governance_summary.md >> "$GITHUB_STEP_SUMMARY"