File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -159,9 +159,18 @@ jobs:
159
159
160
160
echo "Creating temporary branch based on origin/main..."
161
161
# Create a new branch based on the fetched origin/main
162
+ echo "Stashing generated CHANGELOG.md..."
163
+ # Stash the generated changelog (include untracked files like CHANGELOG.md if new)
164
+ git stash push -u -- CHANGELOG.md
165
+
162
166
git checkout -b changelog-update origin/main
163
167
164
168
echo "Adding and committing CHANGELOG.md..."
169
+ echo "Applying stashed CHANGELOG.md..."
170
+ # Apply the stashed changes (the generated CHANGELOG.md)
171
+ # Use || true in case stash is empty (e.g., changelog didn't change)
172
+ git stash pop || true
173
+
165
174
git add ./CHANGELOG.md
166
175
# Check if there are changes to commit to avoid empty commit error if file exists and is unchanged
167
176
if ! git diff --staged --quiet; then
@@ -170,6 +179,9 @@ jobs:
170
179
echo "No changes to CHANGELOG.md to commit."
171
180
fi
172
181
182
+
183
+ echo "Cleaning up temporary local branch..."
184
+ git branch -D changelog-update
173
185
echo "Pushing changelog commit to remote main branch..."
174
186
# Push the new local branch specifically to the remote *branch* main
175
187
git push origin changelog-update:refs/heads/main
You can’t perform that action at this time.
0 commit comments