Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/sync-speedrun-filter-rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Rsync filter rules for scaffold-stark-2 → speedrunstark sync
# P = Protect (never delete from speedrunstark)
# - = Exclude (never copy from scaffold-stark-2)
#
# When adding new speedrun-specific files, add a P rule here.
# When adding new scaffold-stark-2 files that shouldn't sync, add a - rule.

# === PROTECT speedrun-specific files (prevent --delete from removing them) ===

# Merge strategy configs
P .gitattributes
P packages/nextjs/.gitattributes
P packages/snfoundry/.gitattributes

# Speedrun UI components and branding
P packages/nextjs/components/Button/
P packages/nextjs/components/Button/**
P packages/nextjs/components/ButtonStyle/
P packages/nextjs/components/ButtonStyle/**
P packages/nextjs/components/HeaderLogo.tsx
P packages/nextjs/components/icons/
P packages/nextjs/components/icons/**

# Speedrun fonts and assets
P packages/nextjs/font/
P packages/nextjs/font/**
P packages/nextjs/public/icon-starknet.svg
P packages/nextjs/public/logo-header.svg
P packages/nextjs/public/speedrunStarknet.svg
P packages/nextjs/public/starkcompass-icon.svg
P packages/nextjs/public/Starknet-icon.svg
P packages/nextjs/public/starknet.svg

# Speedrun-specific contract files
P packages/snfoundry/contracts/tests/TestContract.cairo
P packages/snfoundry/scripts-ts/helpers/fees.ts

# Speedrun workflows
P .github/workflows/sync_other_challenges.yaml

# Editor and dev tool configs
P .vscode/
P .vscode/**
P .claude/
P .claude/**

# Speedrun project files
P global_rules.md
P submissions.md

# === EXCLUDE from sync (never copy these from scaffold-stark-2) ===

# Git directory
- .git/
- .git/**

# Test files
- __test__/
- __test__/**
- __tests__/
- __tests__/**

# Debug assets
- packages/nextjs/public/debug-image.png
- packages/nextjs/public/rpc-version.png

# Challenge-specific files (each challenge has its own)
- packages/snfoundry/contracts/src/your_contract.cairo

# Environment files (speedrunstark has its own credentials)
- packages/snfoundry/.env
- packages/nextjs/.env

# Deployment files (speedrunstark has its own deployments)
- packages/snfoundry/deployments/

# Docs that are rewritten for speedrunstark
- CHANGELOG*
- CONTRIBUTING*
- README.md

# Husky hooks (not used in speedrunstark)
- .husky/_/
- .husky/_/**
26 changes: 14 additions & 12 deletions .github/workflows/sync-speedrun-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,18 @@ jobs:
run: |
cd speedrun_repo
git checkout base-challenge-template
rsync -av \
--exclude='.git/' \

# Copy filter rules from source repo
cp ../source_repo/.github/sync-speedrun-filter-rules /tmp/sync-filter-rules

rsync -av --delete \
--filter='merge /tmp/sync-filter-rules' \
--include='.github/' \
--include='.github/workflows/' \
--include='.github/workflows/main.yml' \
--include='.github/sync-speedrun-filter-rules' \
--exclude='.github/*' \
--exclude='.github/workflows/*' \
--exclude='__test*__' \
--exclude='packages/nextjs/public/debug-image.png' \
--exclude='packages/nextjs/public/manifest.json' \
--exclude='packages/nextjs/public/rpc-version.png' \
--exclude='packages/snfoundry/contracts/src/your_contract.cairo' \
--exclude='CHANGELOG*' \
--exclude='CONTRIBUTING*' \
--exclude='README.md' \
../source_repo/ ./

# Sync only the Compatible versions section from README.md
Expand Down Expand Up @@ -119,9 +116,14 @@ jobs:
print('Successfully updated Compatible versions section')
"

# Only commit and push if there are actual changes
git add .
git commit -m "chore: sync files from scaffold-stark-2 and update Compatible versions section"
git push origin base-challenge-template
if git diff --cached --quiet; then
echo "No changes to sync — skipping commit"
else
git commit -m "chore: sync files from scaffold-stark-2 and update Compatible versions section"
git push origin base-challenge-template
fi

- name: Notify Slack on Success
if: success()
Expand Down