Sync everything-claude-code #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync opencode from everything-claude-code | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 */6 * * *" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: sync-opencode | |
| cancel-in-progress: false | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout target repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.REPO_PAT }} | |
| - name: Clone upstream repository | |
| run: | | |
| git clone --depth=1 https://github.com/affaan-m/everything-claude-code.git /tmp/ecc | |
| - name: Sync .opencode to opencode | |
| run: | | |
| rm -rf ./opencode | |
| mkdir -p ./opencode | |
| find /tmp/ecc/.opencode -mindepth 1 -maxdepth 1 -type d -exec cp -a {} ./opencode/ \; | |
| if [ -f /tmp/ecc/.opencode/opencode.json ]; then | |
| cp -a /tmp/ecc/.opencode/opencode.json ./opencode/ | |
| fi | |
| - name: Replace model names | |
| run: | | |
| find ./opencode -type f -exec perl -0pi -e ' | |
| s|anthropic/claude-opus-4-5|openai/gpt-5.4|g; | |
| s|anthropic/claude-sonnet-4-5|openai/gpt-5.4|g; | |
| s|anthropic/claude-haiku-4-5|openai/gpt-5.4-mini|g; | |
| ' {} + | |
| - name: Stage opencode changes | |
| run: | | |
| git add -A opencode | |
| - name: Debug status | |
| run: | | |
| echo "===== git status =====" | |
| git status --short | |
| echo "===== staged diff summary =====" | |
| git diff --cached --stat -- opencode || true | |
| - name: Detect staged changes | |
| id: changes | |
| run: | | |
| if git diff --cached --quiet -- opencode; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Commit and push if changed | |
| if: steps.changes.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git commit -m "chore: sync opencode from everything-claude-code" | |
| git push origin HEAD:main |