Setting the file. One moment.
Squad Promote · {skill Name} · microsoft/waza · Skills Docs
ContentsBack to the top of the page 11.14
Plugin Marketplace
workflows/squad-promote.yml
workflows/ squad-promote.yml
YAML · 121 lines · 4 KB
,
'true'
]
12
13 permissions :
14 contents : write
15
16 jobs :
17 dev-to-preview :
18 name : Promote dev → preview
19 runs-on : ubuntu-latest
20 steps :
21 - uses : actions/checkout@v4
22 with :
23 fetch-depth : 0
24 token : ${{ secrets.GITHUB_TOKEN }}
25
26 - name : Configure git
27 run : |
28 git config user.name "github-actions[bot]"
29 git config user.email "github-actions[bot]@users.noreply.github.com"
30
31 - name : Fetch all branches
32 run : git fetch --all
33
34 - name : Show current state (dry run info)
35 run : |
36 echo "=== dev HEAD ===" && git log origin/dev -1 --oneline
37 echo "=== preview HEAD ===" && git log origin/preview -1 --oneline
38 echo "=== Files that would be stripped ==="
39 git diff origin/preview..origin/dev --name-only | grep -E "^(\.(ai-team|squad|ai-team-templates|squad-templates)|team-docs/|docs/proposals/)" || echo "(none)"
40
41 - name : Merge dev → preview (strip forbidden paths)
42 if : ${{ inputs.dry_run == 'false' }}
43 run : |
44 git checkout preview
45 git merge origin/dev --no-commit --no-ff -X theirs || true
46
47 # Strip forbidden paths from merge commit
48 git rm -rf --cached --ignore-unmatch \
49 .ai-team/ \
50 .squad/ \
51 .ai-team-templates/ \
52 .squad-templates/ \
53 team-docs/ \
54 "docs/proposals/" || true
55
56 # Commit if there are staged changes
57 if ! git diff --cached --quiet; then
58 git commit -m "chore: promote dev → preview (v$(node -e "console.log(require('./package.json').version)"))"
59 git push origin preview
60 echo "✅ Pushed preview branch"
61 else
62 echo "ℹ️ Nothing to commit — preview is already up to date"
63 fi
64
65 - name : Dry run complete
66 if : ${{ inputs.dry_run == 'true' }}
67 run : echo "🔍 Dry run complete — no changes pushed."
68
69 preview-to-main :
70 name : Promote preview → main (release)
71 needs : dev-to-preview
72 runs-on : ubuntu-latest
73 steps :
74 - uses : actions/checkout@v4
75 with :
76 fetch-depth : 0
77 token : ${{ secrets.GITHUB_TOKEN }}
78
79 - name : Configure git
80 run : |
81 git config user.name "github-actions[bot]"
82 git config user.email "github-actions[bot]@users.noreply.github.com"
83
84 - name : Fetch all branches
85 run : git fetch --all
86
87 - name : Show current state
88 run : |
89 echo "=== preview HEAD ===" && git log origin/preview -1 --oneline
90 echo "=== main HEAD ===" && git log origin/main -1 --oneline
91 echo "=== Version ===" && node -e "console.log('v' + require('./package.json').version)"
92
93 - name : Validate preview is release-ready
94 run : |
95 git checkout preview
96 VERSION=$(node -e "console.log(require('./package.json').version)")
97 if ! grep -q "## \[$VERSION\]" CHANGELOG.md 2>/dev/null; then
98 echo "::error::Version $VERSION not found in CHANGELOG.md — update before releasing"
99 exit 1
100 fi
101 echo "✅ Version $VERSION has CHANGELOG entry"
102
103 # Verify no forbidden files on preview
104 FORBIDDEN=$(git ls-files | grep -E "^(\.(ai-team|squad|ai-team-templates|squad-templates)/|team-docs/|docs/proposals/)" || true)
105 if [ -n "$FORBIDDEN" ]; then
106 echo "::error::Forbidden files found on preview: $FORBIDDEN"
107 exit 1
108 fi
109 echo "✅ No forbidden files on preview"
110
111 - name : Merge preview → main
112 if : ${{ inputs.dry_run == 'false' }}
113 run : |
114 git checkout main
115 git merge origin/preview --no-ff -m "chore: promote preview → main (v$(node -e "console.log(require('./package.json').version)"))"
116 git push origin main
117 echo "✅ Pushed main — squad-release.yml will tag and publish the release"
118
119 - name : Dry run complete
120 if : ${{ inputs.dry_run == 'true' }}
121 run : echo "🔍 Dry run complete — no changes pushed."