mirror of
https://github.com/penpot/penpot.git
synced 2026-11-20 17:11:15 +00:00
🔧 Fix pr validations
Signed-off-by: Yamila Moreno <yamila.moreno@kaleidos.net>
This commit is contained in:
parent
15a099f118
commit
ea11c4d71d
19
.github/workflows/prs-pre-validations.yml
vendored
19
.github/workflows/prs-pre-validations.yml
vendored
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user