From ea11c4d71d519556c4b068cc25a819532a9be7fb Mon Sep 17 00:00:00 2001 From: Yamila Moreno Date: Fri, 20 Nov 2026 11:58:31 +0100 Subject: [PATCH] :wrench: Fix pr validations Signed-off-by: Yamila Moreno --- .github/workflows/prs-pre-validations.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prs-pre-validations.yml b/.github/workflows/prs-pre-validations.yml index 75c5dacad2..3c9f736a1b 100644 --- a/.github/workflows/prs-pre-validations.yml +++ b/.github/workflows/prs-pre-validations.yml @@ -64,18 +64,29 @@ jobs: console.log(`PR #${pr.number} was opened by a bot; skipping.`); return; } + const { owner, repo } = context.repo; + + // Use the API instead of the webhook, because + // the API reports their real relationship to the repository. + const { data: currentPR } = await github.rest.pulls.get({ + owner, + repo, + pull_number: pr.number + }); + const association = currentPR.author_association; + console.log(`PR #${pr.number} author association from API: ${association}.`); + // Exemption labels such as `no issue required` do not apply to // public contributors: the author classification wins. - if (ASSOCIATIONS_WITH_ACCESS.has(pr.author_association)) { - console.log(`PR #${pr.number} was opened by ${pr.author_association}; skipping.`); + if (ASSOCIATIONS_WITH_ACCESS.has(association)) { + console.log(`PR #${pr.number} was opened by ${association}; skipping.`); return; } - if (pr.author_association === 'MANNEQUIN') { + if (association === 'MANNEQUIN') { console.log(`PR #${pr.number} was opened by a migrated placeholder user; skipping.`); return; } - const { owner, repo } = context.repo; const result = await github.graphql( `query($owner: String!, $repo: String!, $number: Int!) { repository(owner: $owner, name: $repo) {