You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9ca2c1a
Browse filesBrowse the repository at this point in the historyBrowse files
fetch-depth: 0# PSR needs full history + tags to compute the bump
102
+
ref: ${{ github.event.pull_request.head.sha }}
103
+
104
+
- name: Set up the environment
105
+
uses: ./.github/actions/setup-python-env
106
+
107
+
- name: Compute release preview
108
+
id: preview
109
+
run: |
110
+
# PSR only computes a release on the main branch; name the checked-out
111
+
# PR head 'main' so the preview reflects what a merge would release.
112
+
git checkout -B main >/dev/null 2>&1 || true
113
+
current=$(uv version --short 2>/dev/null || echo "unknown")
114
+
next=$(uv run semantic-release version --print 2>/dev/null || echo "")
115
+
if [ -n "$next" ] && [ "$next" != "$current" ]; then
116
+
echo "released=true" >> "$GITHUB_OUTPUT"
117
+
else
118
+
echo "released=false" >> "$GITHUB_OUTPUT"
119
+
fi
120
+
echo "current=$current" >> "$GITHUB_OUTPUT"
121
+
echo "next=$next" >> "$GITHUB_OUTPUT"
122
+
# Stamp the upcoming changelog section locally (no commit/tag/push/build)
123
+
# so the preview shows the notes this merge would add.
124
+
if [ -n "$next" ] && [ "$next" != "$current" ]; then
125
+
uv run semantic-release version --no-commit --no-tag --no-push --no-vcs-release --skip-build >/dev/null 2>&1 || true
126
+
fi
127
+
{
128
+
echo "changelog<<PSR_EOF"
129
+
git --no-pager diff HEAD -- CHANGELOG.md | awk '/^\+/ && !/^\+\+\+/ {sub(/^\+/,""); print}' | head -80
130
+
echo "PSR_EOF"
131
+
} >> "$GITHUB_OUTPUT"
132
+
133
+
- name: Post release preview comment
134
+
uses: marocchino/sticky-pull-request-comment@v2
135
+
with:
136
+
header: version-preview
137
+
message: |
138
+
## Release preview
139
+
140
+
${{ steps.preview.outputs.released == 'true' && format('Merging this PR would release **v{0}** (current: `v{1}`).', steps.preview.outputs.next, steps.preview.outputs.current) || format('No version bump from the current commits (stays at `v{0}`). Use conventional commit types (`feat`, `fix`, ...) to trigger a release.', steps.preview.outputs.current) }}
0 commit comments