File tree Expand file tree Collapse file tree 5 files changed +152
-12
lines changed
Expand file tree Collapse file tree 5 files changed +152
-12
lines changed Original file line number Diff line number Diff line change 1+ name : Branch Policy
2+
3+ on :
4+ pull_request :
5+ branches : [main]
6+
7+ jobs :
8+ check-branch :
9+ name : Check source branch
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Verify source branch
13+ run : |
14+ SOURCE_BRANCH="${{ github.head_ref }}"
15+ echo "Source branch: $SOURCE_BRANCH"
16+
17+ # Allow PRs from develop or fix/* branches only
18+ if [[ "$SOURCE_BRANCH" == "develop" ]] || [[ "$SOURCE_BRANCH" == fix/* ]]; then
19+ echo "✓ PR from '$SOURCE_BRANCH' to main is allowed"
20+ else
21+ echo "✗ PR from '$SOURCE_BRANCH' to main is NOT allowed"
22+ echo ""
23+ echo "Only the following branches can merge to main:"
24+ echo " - develop"
25+ echo " - fix/*"
26+ echo ""
27+ echo "Please merge your changes to develop first."
28+ exit 1
29+ fi
Original file line number Diff line number Diff line change @@ -25,17 +25,14 @@ jobs:
2525 needs : changes
2626 if : needs.changes.outputs.python == 'true'
2727 runs-on : ubuntu-latest
28- strategy :
29- matrix :
30- python-version : ["3.13"]
3128
3229 steps :
3330 - uses : actions/checkout@v6
3431
35- - name : Set up Python ${{ matrix.python-version }}
32+ - name : Set up Python
3633 uses : actions/setup-python@v6
3734 with :
38- python-version : ${{ matrix.python-version }}
35+ python-version : " 3.13 "
3936
4037 - name : Install dependencies
4138 run : |
Original file line number Diff line number Diff line change @@ -3,20 +3,37 @@ name: Update Screenshots
33on :
44 push :
55 branches : [develop]
6- paths :
7- - " _bmad-output/planning-artifacts/ux-design-directions.html"
8- - " scripts/generate-screenshots.mjs"
6+ pull_request :
7+ branches : [develop, main]
98 workflow_dispatch :
109
1110jobs :
11+ changes :
12+ runs-on : ubuntu-latest
13+ outputs :
14+ mockups : ${{ steps.filter.outputs.mockups }}
15+ steps :
16+ - uses : actions/checkout@v6
17+ - uses : dorny/paths-filter@v3
18+ id : filter
19+ with :
20+ filters : |
21+ mockups:
22+ - '_bmad-output/planning-artifacts/ux-design-directions.html'
23+ - 'scripts/generate-screenshots.mjs'
24+
1225 generate :
26+ needs : changes
27+ if : needs.changes.outputs.mockups == 'true'
1328 runs-on : ubuntu-latest
1429
1530 steps :
16- - uses : actions/checkout@v4
31+ - uses : actions/checkout@v6
32+ with :
33+ ref : develop
1734
1835 - name : Setup Node.js
19- uses : actions/setup-node@v4
36+ uses : actions/setup-node@v6
2037 with :
2138 node-version : " 22"
2239 cache : " npm"
3653 git diff --quiet docs/src/assets/screenshots/ || echo "changed=true" >> $GITHUB_OUTPUT
3754
3855 - name : Create Pull Request
39- if : steps.changes.outputs.changed == 'true'
56+ if : steps.changes.outputs.changed == 'true' && github.event_name == 'push'
4057 uses : peter-evans/create-pull-request@v6
4158 with :
4259 token : ${{ secrets.GITHUB_TOKEN }}
5269 labels : |
5370 automated
5471 documentation
72+
73+ generate-skipped :
74+ needs : changes
75+ if : needs.changes.outputs.mockups != 'true'
76+ runs-on : ubuntu-latest
77+ steps :
78+ - run : echo "No mockup changes detected, skipping screenshot generation"
Original file line number Diff line number Diff line change 44 },
55 "dependencies" : {
66 "glob" : " ^13.0.0"
7- }
7+ }
88}
You can’t perform that action at this time.
0 commit comments