diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3dcfe811..e6af8dca9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,4 +132,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} - diff --git a/scripts/dev-lead-fix-issue.sh b/scripts/dev-lead-fix-issue.sh index f3e89572d..c925a373f 100755 --- a/scripts/dev-lead-fix-issue.sh +++ b/scripts/dev-lead-fix-issue.sh @@ -17,6 +17,18 @@ check_existing_pr() { [ "$existing" -gt 0 ] } +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 + git config user.email "${bot_id}+${bot}@users.noreply.github.com" + else + git config user.email "${bot}@users.noreply.github.com" + fi + git config user.name "$bot" +} + main() { if [ -z "$ISSUE_NUMBER" ]; then echo "::error::ISSUE_NUMBER is required" @@ -47,6 +59,10 @@ main() { exit 0 fi + # Configure git identity so the post-engine commit does not fail. + # BOT_USER is set as a job-level env var in dev-lead-reusable.yml. + setup_git_identity + # Create feature branch local branch branch="dev-lead/issue-${ISSUE_NUMBER}-$(date +%Y%m%d-%H%M)"