File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Check whether changelog.d/ contains any fragments (ignoring .gitkeep).
3+ # Sets the GitHub Actions output "count" so later steps can skip if 0.
4+ set -euo pipefail
5+
6+ FRAGMENTS=$( ls changelog.d/ | grep -cv .gitkeep || true)
7+ echo " count=$FRAGMENTS " >> " $GITHUB_OUTPUT "
8+
9+ if [ " $FRAGMENTS " -eq 0 ]; then
10+ echo " No changelog fragments found — skipping release."
11+ else
12+ echo " Found $FRAGMENTS changelog fragment(s)."
13+ fi
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Stage release artifacts and push if anything changed.
3+ set -euo pipefail
4+
5+ git config user.name " github-actions[bot]"
6+ git config user.email " github-actions[bot]@users.noreply.github.com"
7+
8+ git add package.json CHANGELOG.md changelog.d/
9+
10+ if git diff --staged --quiet; then
11+ echo " No changes to commit."
12+ exit 0
13+ fi
14+
15+ git commit -m " Release @policyengine/ui-kit"
16+ git push
Original file line number Diff line number Diff line change 88 release :
99 name : Bump version, build changelog, publish to npm
1010 runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
1113 if : " !contains(github.event.head_commit.message, 'Release @policyengine/ui-kit')"
1214
1315 steps :
14- - uses : actions/checkout@v4
15- with :
16- token : ${{ secrets.POLICYENGINE_GITHUB }}
16+ - uses : actions/checkout@v6
1717
1818 - name : Check for changelog fragments
1919 id : check
20- run : |
21- FRAGMENTS=$(ls changelog.d/ | grep -v .gitkeep | wc -l)
22- echo "count=$FRAGMENTS" >> "$GITHUB_OUTPUT"
20+ run : .github/check_fragments.sh
2321
2422 - name : Bump version
2523 if : steps.check.outputs.count != '0'
5654
5755 - name : Commit and push
5856 if : steps.check.outputs.count != '0'
59- uses : EndBug/add-and-commit@v9
60- with :
61- message : " Release @policyengine/ui-kit"
62- default_author : github_actions
63- add : |
64- package.json
65- CHANGELOG.md
66- changelog.d/
57+ run : .github/commit_and_push.sh
Original file line number Diff line number Diff line change 1+ Fix CI/CD workflow: drop expired PAT, use default GITHUB_TOKEN, extract scripts
You can’t perform that action at this time.
0 commit comments