-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 2.12 KB
/
Copy pathsync-skills.yml
File metadata and controls
71 lines (61 loc) · 2.12 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
name: sync-skills
on:
schedule:
# Sunday 03:00 UTC — weekly refresh
- cron: "0 3 * * 0"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: sync-skills
cancel-in-progress: false
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Run sync script
id: sync
run: python scripts/sync_skills.py
- name: Detect changes
id: changes
run: |
if [[ -z "$(git status --porcelain skills/)" ]]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "No skill changes detected."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
added=$(git status --porcelain skills/ | grep -c '^??' || true)
modified=$(git status --porcelain skills/ | grep -c '^ M' || true)
deleted=$(git status --porcelain skills/ | grep -c '^ D' || true)
echo "added=$added" >> "$GITHUB_OUTPUT"
echo "modified=$modified" >> "$GITHUB_OUTPUT"
echo "deleted=$deleted" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push
if: steps.changes.outputs.changed == 'true'
env:
ADDED: ${{ steps.changes.outputs.added }}
MODIFIED: ${{ steps.changes.outputs.modified }}
DELETED: ${{ steps.changes.outputs.deleted }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# README headline counts are regenerated from the live tree by the
# sync script — stage it alongside skills/ so they stay in lockstep.
git add skills/ README.md
today=$(date -u +%Y-%m-%d)
git commit -m "chore: weekly upstream skill sync (${today})
added: ${ADDED}
modified: ${MODIFIED}
deleted: ${DELETED}"
git push