Skip to content

Commit 022b8dc

Browse files
committed
ci: add day-1 boundary checks and PR template
1 parent 00d0d3e commit 022b8dc

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Summary
2+
3+
- What changed:
4+
- Why:
5+
6+
## AI Intent
7+
8+
- Prompt or task statement:
9+
- Scope of AI-assisted changes:
10+
11+
## Risk Assessment
12+
13+
- Risk level: low / medium / high
14+
- Primary risks:
15+
- Compatibility impact:
16+
17+
## Rollback Plan
18+
19+
- Revert path:
20+
- Forward-fix path (if revert is not possible):
21+
22+
## Validation
23+
24+
- Local checks run:
25+
- CI checks expected:
26+
27+
## Internal/Public Boundary Check
28+
29+
- [ ] No internal-only data, private URLs, secrets, or private runbooks were added.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "agent-boundary-check"
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
boundary-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: "Validate changed files for internal-only markers"
18+
shell: bash
19+
run: |
20+
set -euo pipefail
21+
22+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
23+
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
24+
25+
mapfile -t CHANGED < <(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
26+
if [ "${#CHANGED[@]}" -eq 0 ]; then
27+
echo "No changed files detected"
28+
exit 0
29+
fi
30+
31+
FORBIDDEN='(INTERNAL[- ]ONLY|internal[- ]only|control plane|private runbook|do not share|confidential|confluence|notion|vpn|internal\\.)'
32+
STATUS=0
33+
34+
for f in "${CHANGED[@]}"; do
35+
[ -f "$f" ] || continue
36+
case "$f" in
37+
*.md|*.txt|*.yml|*.yaml|*.json|*.toml|*.ts|*.tsx|*.js|*.jsx|*.sh|*.py|*.rb|*.tf|*.hcl)
38+
if grep -Einq "$FORBIDDEN" "$f"; then
39+
echo "::error file=$f::Potential internal-only marker detected"
40+
grep -Ein "$FORBIDDEN" "$f" || true
41+
STATUS=1
42+
fi
43+
;;
44+
esac
45+
done
46+
47+
exit "$STATUS"

0 commit comments

Comments
 (0)