From 3cb3d4d39b577a01a1e35dbfa16eded46d1f0f25 Mon Sep 17 00:00:00 2001 From: Dorac Date: Mon, 22 Jun 2026 19:01:29 +0800 Subject: [PATCH] fix: remove ci_run_id from Rule 1 condition to support Cloud Build repos ci_run_id is unavailable for non-GitHub-Actions CI (e.g. Cloud Build). The previous Rule 1 triggered on empty ci_run_id regardless of CI outcome, causing all Cloud Build PRs to be labeled ai-skipped-ci-failed even when CI passed. Rule 1 now only checks ci_conclusion; ci_run_id emptiness only affects whether Step 2 log analysis can run. --- .github/workflows/dependabot_auto_merge.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dependabot_auto_merge.yml b/.github/workflows/dependabot_auto_merge.yml index 4255c9e..e8bf3ca 100644 --- a/.github/workflows/dependabot_auto_merge.yml +++ b/.github/workflows/dependabot_auto_merge.yml @@ -246,15 +246,17 @@ jobs: Run: gh pr view ${{ inputs.pr_number }} --json body --jq '.body' --repo ${{ github.repository }} Identify: security fixes, API changes, deprecations, breaking changes. - Step 2 — Fetch CI failure details (only if ci_conclusion is not "success" OR ci_run_id is empty) + Step 2 — Fetch CI failure details (only if ci_conclusion is not "success" AND ci_run_id is non-empty) 2a. Get failed job and step names: gh api repos/${{ github.repository }}/actions/runs/${{ inputs.ci_run_id }}/jobs \ --jq '.jobs[] | select(.conclusion == "failure") | {job: .name, failed_steps: [.steps[] | select(.conclusion == "failure") | .name]}' 2b. Get error messages from the failed log: gh run view ${{ inputs.ci_run_id }} --log-failed --repo ${{ github.repository }} \ | grep -E "ERROR:|##\[error\]" | head -5 + If ci_run_id is empty and ci_conclusion is not "success", skip Step 2 and set + Failed job, Step, and Error in the comment to "N/A — CI run ID unavailable, check CI provider directly". - Step 3 — Check codebase usage (only if ci_conclusion is "success" AND ci_run_id is non-empty) + Step 3 — Check codebase usage (only if ci_conclusion is "success") For each updated package run: grep -r "" . --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" -l 2>/dev/null For each changed API or method mentioned in changelog, also run: @@ -264,12 +266,11 @@ jobs: Apply these rules in order and stop at the first match: - Rule 1 — CI failed or CI run ID unavailable - Condition: ci_conclusion is not "success" OR ci_run_id is empty + Rule 1 — CI failed + Condition: ci_conclusion is not "success" Action: - gh pr edit ${{ inputs.pr_number }} --add-label "ai-skipped-ci-failed" --repo ${{ github.repository }} - Template: /tmp/dependabot-templates/ci-failed.md - - If ci_run_id was empty, set Failed job and Step to "N/A — CI run ID unavailable, check the Actions tab manually" Rule 2 — Major or unknown bump Condition: worst_bump is "major" or "unknown"