@@ -88,6 +88,7 @@ require_cmd() {
8888
8989# ── pre-flight checks ──────────────────────────────────────────────────────
9090
91+ require_cmd git
9192require_cmd gh
9293require_cmd jq
9394require_cmd curl
@@ -197,6 +198,19 @@ if [[ -z "$SYSTEM_PROMPT" ]]; then
197198 exit 1
198199fi
199200
201+ # ── configure git identity (required for commits) ─────────────────────────
202+ # Use existing config when available; fall back to neutral defaults so the
203+ # script works in CI environments that have no pre-configured identity.
204+
205+ if [[ " $DRY_RUN " != " true" ]]; then
206+ if ! git config user.email > /dev/null 2>&1 ; then
207+ git config user.email " actions@github.com"
208+ fi
209+ if ! git config user.name > /dev/null 2>&1 ; then
210+ git config user.name " github-actions[bot]"
211+ fi
212+ fi
213+
200214# ── process each PR ────────────────────────────────────────────────────────
201215
202216call_model_api () {
@@ -297,6 +311,10 @@ for row in $(jq -r '.[] | @base64' <<< "$PR_JSON"); do
297311 # ── write the updated file ─────────────────────────────────────────────
298312 printf ' %s' " $updated_announcement " > " $ANNOUNCEMENT_FILE "
299313 success " Updated announcement with changes from PR #${pr_number} ."
314+
315+ # ── commit this PR's change as its own commit ──────────────────────────
316+ git add " $ANNOUNCEMENT_FILE "
317+ git commit -m " Release announcement: ${pr_info} "
300318 PROCESSED=$(( PROCESSED + 1 ))
301319done
302320
@@ -310,9 +328,8 @@ info "PRs with no user-relevant changes: ${UNCHANGED}"
310328if [[ " $DRY_RUN " == " true" ]]; then
311329 warn " DRY_RUN=true — no files were modified."
312330else
313- success " ReleaseAnnouncement.md has been updated."
331+ success " ReleaseAnnouncement.md has been updated and each change committed ."
314332 echo
315- echo " Review the result, then commit with:"
316- echo " git add ReleaseAnnouncement.md"
317- echo " git commit -m 'docs: backfill Release Announcement from ${SINCE_TAG} '"
333+ echo " Push all commits with:"
334+ echo " git push"
318335fi
0 commit comments