Fix workflow branch name #3
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 GStack to CodeBuddy | ||
| on: | ||
| schedule: | ||
| # Run daily at midnight UTC to check for updates | ||
| - cron: '0 0 * * *' | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - master | ||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Git | ||
| run: | | ||
| git config --global user.name "GStack Bot" | ||
| git config --global user.email "bot@github.com" | ||
| - name: Check for GStack updates | ||
| id: check | ||
| run: | | ||
| # Add GStack as remote | ||
| git remote add gstack https://github.com/garrytan/gstack.git || true | ||
| # Fetch latest | ||
| git fetch gstack main --depth 1 | ||
| # Check if there are new commits | ||
| LOCAL=$(git rev-parse HEAD) | ||
| REMOTE=$(git rev-parse gstack/main) | ||
| if [ "$LOCAL" != "$REMOTE" ]; then | ||
| echo "updates=true" >> $GITHUB_OUTPUT | ||
| echo "New GStack commits detected: $LOCAL -> $REMOTE" | ||
| else | ||
| echo "updates=false" >> $GITHUB_OUTPUT | ||
| echo "GStack is up to date" | ||
| fi | ||
| - name: Create backup of original SKILL.md | ||
| if: steps.check.outputs.updates == 'true' | ||
| run: | | ||
| cp SKILL.md SKILL.md.backup || true | ||
| - name: Pull GStack | ||
| if: steps.check.outputs.updates == 'true' | ||
| run: | | ||
| git subtree pull --prefix=gstack gstack main --squash || \ | ||
| git pull gstack main --allow-unrelated-histories || true | ||
| - name: Update CodeBuddy SKILL.md | ||
| if: steps.check.outputs.updates == 'true' | ||
| run: | | ||
| # Create CodeBuddy-compatible SKILL.md if it doesn't exist | ||
| if [[ ! -f "SKILL.md" ]]; then | ||
| cat > SKILL.md << 'EOF' | ||
| # GStack | ||
| 31 specialized AI agents for product development. | ||
| ## Skills | ||
| - /office-hours - Product brainstorming | ||
| - /plan-ceo-review - CEO review | ||
| - /plan-eng-review - Engineering review | ||
| - /plan-design-review - Design review | ||
| - /autoplan - Automated planning | ||
| - /design-consultation - Design partner | ||
| - /design-shotgun - Design exploration | ||
| - /design-html - HTML generation | ||
| - /design-review - Design review | ||
| - /review - Code review | ||
| - /investigate - Debugging | ||
| - /codex - Codex second opinion | ||
| - /cso - Security audit | ||
| - /qa - QA testing | ||
| - /qa-only - Bug reporting | ||
| - /browse - Browser automation | ||
| - /ship - Open PR | ||
| - /land-and-deploy - Deploy | ||
| - /canary - Monitoring | ||
| - /benchmark - Performance | ||
| - /document-release - Docs | ||
| - /retro - Team retro | ||
| - /learn - Memory | ||
| - /careful - Warnings | ||
| - /freeze - Lock | ||
| - /guard - Full safety | ||
| - /unfreeze - Unlock | ||
| - /connect-chrome - Chrome | ||
| - /setup-browser-cookies - Cookies | ||
| - /setup-deploy - Deploy config | ||
| - /gstack-upgrade - Updater | ||
| ## Credit | ||
| By Garry Tan (Y Combinator) | ||
| MIT License | ||
| EOF | ||
| fi | ||
| - name: Create/update scripts | ||
| run: | | ||
| # Ensure scripts are present | ||
| chmod +x setup-codebuddy.sh 2>/dev/null || true | ||
| - name: Commit and tag | ||
| if: steps.check.outputs.updates == 'true' | ||
| run: | | ||
| DATE=$(date +%Y%m%d) | ||
| git add -A | ||
| git commit -m "Sync with GStack $(date '+%Y-%m-%d')" || true | ||
| git tag "v$DATE" -f || true | ||
| - name: Push changes | ||
| if: steps.check.outputs.updates == 'true' | ||
| run: | | ||
| git push origin main --force || true | ||
| git push origin "v$(date +%Y%m%d)" -f --tags || true | ||
| - name: Create Release | ||
| if: steps.check.outputs.updates == 'true' | ||
| uses: actions/create-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: v${{ steps.date.outputs.date }} | ||
| release_name: GStack CodeBuddy v${{ steps.date.outputs.date }} | ||
| body: | | ||
| Synced with latest GStack release. | ||
| ## Installation | ||
| ```bash | ||
| curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | bash -s -- --project | ||
| ``` | ||
| Or see README.md for full installation instructions. | ||
| draft: false | ||
| prerelease: false | ||
| notify: | ||
| needs: sync | ||
| if: always() && needs.sync.result == 'success' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Success notification | ||
| if: needs.sync.outputs.updates == 'true' | ||
| run: echo "GStack synced successfully!" | ||