Scheduling infrastructure for absolutely everyone.
fix: skip stale run-ci label check on workflow re-runs (#26590)
Anik Dhabal Babu67faf454d902
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.ymlindex 8ae140d254d..3a05287fdfb 100644--- a/.github/workflows/pr.yml+++ b/.github/workflows/pr.yml@@ -97,6 +97,15 @@ jobs:// NOTE: We use workflow run created_at instead of commit timestamp because// git commit timestamps can be arbitrarily backdated by attackersif (pr.labels?.some(l => l.name === 'run-ci')) {+ // Skip stale check if this is a re-run (run_attempt > 1)+ // Re-runs are explicitly triggered by maintainers+ const runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT || '1', 10);+ if (runAttempt > 1) {+ console.log(`Re-run detected (attempt ${runAttempt}), trusting existing 'run-ci' label`);+ core.setOutput('is-trusted', true);+ return;+ }+const events = await github.paginate(github.rest.issues.listEvents, {owner,repo,