Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/dev-lead-fix-reviews.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fi
# Checkout the PR branch for modification (Requirement 1)
if [ "${DEV_LEAD_DRY_RUN:-false}" = "false" ] && [ -n "${PR_NUMBER:-}" ]; then
gh pr checkout "$PR_NUMBER" --repo "$REPO"
setup_git_identity
fi

build_and_run() {
Expand Down Expand Up @@ -375,6 +376,9 @@ commit_and_push() {
# before committing or commit fails with "fatal: empty ident name".
setup_git_identity
git add -A
# Ensure git identity is set — actions/checkout only sets local config for the
# repo it checks out (.github-private), not for target repos cloned separately.
setup_git_identity
# Explicit exit on failure: set -e is suspended when commit_and_push is called from
# an if-statement condition, so git commit failures would be silently swallowed
# otherwise. Using exit (not return) ensures CI fails visibly instead of posting a
Expand Down
5 changes: 4 additions & 1 deletion scripts/lib/git-identity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

# setup_git_identity — configure git user.name/user.email for the bot user.
#
# GitHub-hosted runners lack git identity by default; this helper ensures
# commits succeed whether we're committing to the primary repo or secondary checkouts.
#
# BOT_USER env var (default: donpetry-bot) determines the identity. The
# canonical noreply form (<id>+<login>@users.noreply.github.com) is preferred
# because it links commits to the bot's GitHub profile; fall back to the
Expand All @@ -23,7 +26,7 @@ setup_git_identity() {
local bot="${BOT_USER:-donpetry-bot}"
local bot_id
bot_id=$(gh api "users/${bot}" --jq '.id' 2>/dev/null || echo "")
if [ -n "$bot_id" ]; then
if [[ -n $bot_id ]]; then
git config user.email "${bot_id}+${bot}@users.noreply.github.com"
else
git config user.email "${bot}@users.noreply.github.com"
Expand Down
Loading