-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (48 loc) · 1.52 KB
/
pr-skill-context.yml
File metadata and controls
57 lines (48 loc) · 1.52 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
name: PR Skill Context
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
permissions:
contents: read
jobs:
token-report:
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
TOKEN_ENCODING: cl100k_base
MIN_TOKEN_DELTA: "20"
MIN_PERCENT_DELTA: "5"
steps:
- name: Check out PR head
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Sync project dependencies
run: uv sync --locked
- name: Ensure base commit is available
run: git fetch --no-tags origin ${{ github.event.pull_request.base.sha }}
- name: Compare skill context
run: |
uv run python scripts/compare-skill-context.py \
--base-ref "${{ github.event.pull_request.base.sha }}" \
--head-ref "${{ github.event.pull_request.head.sha }}" \
--encoding "$TOKEN_ENCODING" \
--min-abs-delta "$MIN_TOKEN_DELTA" \
--min-percent-delta "$MIN_PERCENT_DELTA" \
--markdown-out skill-context-report.md
- name: Add workflow summary
run: cat skill-context-report.md >> "$GITHUB_STEP_SUMMARY"
- name: Upsert PR comment
uses: thollander/actions-comment-pull-request@v3
with:
file-path: skill-context-report.md
comment-tag: skill-context-report
mode: upsert