From 19fe354c78550a51536db42324bbdddd5f03cbae Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sat, 29 Aug 2026 22:22:27 +0200 Subject: [PATCH] tools: retry first-time contributor query Retry unresolved author associations with exponential backoff so GitHub has time to populate first-time contributor status. Log the elapsed time for each query to show when the status becomes available. Signed-off-by: Filip Skokan --- .github/workflows/first-time-contributor.yml | 33 +++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/first-time-contributor.yml b/.github/workflows/first-time-contributor.yml index 2d0c268c33d1..f825cd77dc05 100644 --- a/.github/workflows/first-time-contributor.yml +++ b/.github/workflows/first-time-contributor.yml @@ -33,18 +33,29 @@ jobs: GH_TOKEN: ${{ github.token }} NUMBER: ${{ github.event.pull_request.number }} run: | - association=$(gh api "/repos/$GITHUB_REPOSITORY/pulls/$NUMBER" \ - --jq '.author_association') - echo "Author association: $association" + started_at=$SECONDS + for delay in 15 30 60 120; do + sleep "$delay" + association=$(gh api "/repos/$GITHUB_REPOSITORY/pulls/$NUMBER" \ + --jq '.author_association') + elapsed=$((SECONDS - started_at)) + echo "Author association after ${elapsed}s: $association" - case "$association" in - FIRST_TIMER|FIRST_TIME_CONTRIBUTOR) - echo 'eligible=true' >> "$GITHUB_OUTPUT" - ;; - *) - echo 'eligible=false' >> "$GITHUB_OUTPUT" - ;; - esac + case "$association" in + FIRST_TIMER|FIRST_TIME_CONTRIBUTOR) + echo 'eligible=true' >> "$GITHUB_OUTPUT" + exit 0 + ;; + NONE) + ;; + *) + echo 'eligible=false' >> "$GITHUB_OUTPUT" + exit 0 + ;; + esac + done + + echo 'eligible=false' >> "$GITHUB_OUTPUT" agentscan: needs: first_time_contributor