Skip to content

Commit 9b8c7cc

Browse files
committed
add workflow to help syncing to claude-scienfific-skills on new release trigger
1 parent 24a30b7 commit 9b8c7cc

2 files changed

Lines changed: 79 additions & 1 deletion

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Sync to Claude Scientific Skills
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
sync:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- name: Checkout this repository
14+
uses: actions/checkout@v4
15+
with:
16+
path: idc-skill
17+
18+
- name: Extract version from release tag
19+
id: version
20+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
21+
22+
- name: Clone upstream claude-scientific-skills
23+
run: |
24+
git clone https://github.com/K-Dense-AI/claude-scientific-skills.git scientific-skills
25+
26+
- name: Update skill files
27+
run: |
28+
# Target directory in the scientific-skills repo
29+
TARGET_DIR="scientific-skills/scientific-skills/imaging-data-commons"
30+
31+
# Remove existing files
32+
rm -rf "$TARGET_DIR"
33+
mkdir -p "$TARGET_DIR"
34+
35+
# Copy SKILL.md and references directory
36+
cp idc-skill/SKILL.md "$TARGET_DIR/"
37+
cp -r idc-skill/references "$TARGET_DIR/"
38+
39+
echo "Updated files in $TARGET_DIR:"
40+
ls -la "$TARGET_DIR"
41+
42+
- name: Create branch with updated skill
43+
id: create-branch
44+
run: |
45+
cd scientific-skills
46+
47+
BRANCH_NAME="update-idc-skill-to-v${{ steps.version.outputs.version }}"
48+
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
52+
git checkout -b "$BRANCH_NAME"
53+
git add scientific-skills/imaging-data-commons/
54+
55+
# Check if there are changes to commit
56+
if git diff --staged --quiet; then
57+
echo "No changes to commit"
58+
echo "has_changes=false" >> $GITHUB_OUTPUT
59+
exit 0
60+
fi
61+
62+
git commit -m "Update imaging-data-commons skill to v${{ steps.version.outputs.version }}"
63+
echo "has_changes=true" >> $GITHUB_OUTPUT
64+
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
65+
66+
- name: Push branch to idc-claude-skill repo
67+
if: steps.create-branch.outputs.has_changes == 'true'
68+
run: |
69+
cd scientific-skills
70+
71+
BRANCH_NAME="${{ steps.create-branch.outputs.branch_name }}"
72+
73+
# Add this repo as a remote and push the branch there
74+
git remote add idc-repo https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
75+
git push idc-repo "$BRANCH_NAME"
76+
77+
echo "::notice::Pushed branch '$BRANCH_NAME' to ${{ github.repository }}"
78+
echo "::notice::Create PR at: https://github.com/K-Dense-AI/claude-scientific-skills/compare/main...${{ github.repository_owner }}:claude-scientific-skills:$BRANCH_NAME"

SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,6 @@ columns = [(c['name'], c['type'], c.get('description', '')) for c in schema['col
11711171

11721172
### Skill Updates
11731173

1174-
This skill is version 1.0.0. To check for updates:
1174+
This skill version is available in skill metadata. To check for updates:
11751175
- Visit the [releases page](https://github.com/ImagingDataCommons/idc-claude-skill/releases)
11761176
- Watch the repository on GitHub (Watch → Custom → Releases)

0 commit comments

Comments
 (0)