@@ -29,41 +29,36 @@ jobs:
2929 - name : Check for GStack updates
3030 id : check
3131 run : |
32- # Add GStack as remote
33- git remote add gstack https://github.com/garrytan/gstack.git || true
32+ # Add GStack as remote if not exists
33+ git remote add gstack https://github.com/garrytan/gstack.git 2>/dev/null || true
3434
3535 # Fetch latest
36- git fetch gstack main --depth 1
36+ git fetch gstack main --depth 1 2>/dev/null || git fetch gstack master --depth 1 2>/dev/null || true
3737
3838 # Check if there are new commits
3939 LOCAL=$(git rev-parse HEAD)
40- REMOTE=$(git rev-parse gstack/main)
40+ REMOTE=$(git rev-parse gstack/main 2>/dev/null || git rev-parse gstack/master 2>/dev/null || echo "$LOCAL" )
4141
4242 if [ "$LOCAL" != "$REMOTE" ]; then
4343 echo "updates=true" >> $GITHUB_OUTPUT
44- echo "New GStack commits detected: $LOCAL -> $REMOTE "
44+ echo "New GStack commits detected"
4545 else
4646 echo "updates=false" >> $GITHUB_OUTPUT
4747 echo "GStack is up to date"
4848 fi
4949
50- - name : Create backup of original SKILL.md
51- if : steps.check.outputs.updates == 'true'
52- run : |
53- cp SKILL.md SKILL.md.backup || true
54-
5550 - name : Pull GStack
5651 if : steps.check.outputs.updates == 'true'
5752 run : |
58- git subtree pull --prefix=gstack gstack main --squash || \
59- git pull gstack main --allow-unrelated-histories || true
53+ git subtree pull --prefix=gstack gstack main --squash 2>/dev/null || \
54+ git subtree pull --prefix=gstack gstack master --squash 2>/dev/null || \
55+ git pull gstack main --allow-unrelated-histories 2>/dev/null || true
6056
61- - name : Update CodeBuddy SKILL.md
57+ - name : Create/update SKILL.md
6258 if : steps.check.outputs.updates == 'true'
6359 run : |
64- # Create CodeBuddy-compatible SKILL.md if it doesn't exist
65- if [[ ! -f "SKILL.md" ]]; then
66- cat > SKILL.md << 'EOF'
60+ # Update the SKILL.md with latest GStack info
61+ cat > SKILL.md << 'EOF'
6762# GStack
6863
696431 specialized AI agents for product development.
@@ -107,12 +102,6 @@ jobs:
107102By Garry Tan (Y Combinator)
108103MIT License
109104EOF
110- fi
111-
112- - name : Create/update scripts
113- run : |
114- # Ensure scripts are present
115- chmod +x setup-codebuddy.sh 2>/dev/null || true
116105
117106 - name : Commit and tag
118107 if : steps.check.outputs.updates == 'true'
125114 - name : Push changes
126115 if : steps.check.outputs.updates == 'true'
127116 run : |
128- git push origin main --force || true
117+ git push origin master --force || true
129118 git push origin "v$(date +%Y%m%d)" -f --tags || true
130-
131- - name : Create Release
132- if : steps.check.outputs.updates == 'true'
133- uses : actions/create-release@v1
134- env :
135- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
136- with :
137- tag_name : v${{ steps.date.outputs.date }}
138- release_name : GStack CodeBuddy v${{ steps.date.outputs.date }}
139- body : |
140- Synced with latest GStack release.
141-
142- ## Installation
143-
144- ```bash
145- curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | bash -s -- --project
146- ```
147-
148- Or see README.md for full installation instructions.
149- draft : false
150- prerelease : false
151-
152- notify :
153- needs : sync
154- if : always() && needs.sync.result == 'success'
155- runs-on : ubuntu-latest
156-
157- steps :
158- - name : Success notification
159- if : needs.sync.outputs.updates == 'true'
160- run : echo "GStack synced successfully!"
0 commit comments