-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (37 loc) · 1.13 KB
/
agentdiff-policy.yml
File metadata and controls
45 lines (37 loc) · 1.13 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
name: AgentDiff Policy Check
on:
pull_request:
permissions:
contents: read
checks: write
pull-requests: write
jobs:
policy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch agentdiff refs
run: |
git fetch origin '+refs/agentdiff/*:refs/agentdiff/*' || true
- name: Check out PR head branch
env:
HEAD_REF: ${{ github.head_ref }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
git checkout -B "$HEAD_REF" "$HEAD_SHA"
- name: Install agentdiff
run: |
curl -fsSL https://raw.githubusercontent.com/codeprakhar25/agentdiff/main/install.sh | bash
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check policy
run: |
agentdiff policy check --format github-annotations
- name: Post attribution comment
if: always()
env:
GH_TOKEN: ${{ github.token }}
run: |
PR="${{ github.event.pull_request.number }}"
agentdiff report --format markdown --post-pr-comment "$PR" || true