diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 0be65fe6ab7..90f2a8d2cc7 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -227,48 +227,6 @@ jobs: } } - - name: Label PR based on author's GitHub org membership - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 - if: startsWith(github.event_name, 'pull_request') && github.event.action != 'closed' - with: - script: | - const orgLabels = { - "amutable": "downstream/amutable", - }; - - const author = context.payload.pull_request.user.login; - - const labels = []; - for (const [org, label] of Object.entries(orgLabels)) { - /* The workflow token is not a member of these organizations, so - * GitHub only reveals public memberships to it. Members have to - * make their membership public to get the label. */ - try { - await github.rest.orgs.checkPublicMembershipForUser({ - org: org, - username: author, - }); - labels.push(label); - } catch (error) { - if (error.status !== 404) { - throw error; - } - } - } - - if (labels.length == 0) { - core.info(`${author} is not a public member of any listed organization`); - } else if (process.env.SELF_TEST == "true") { - core.info(`Would add ${labels.join(", ")}`); - } else { - await github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: labels, - }); - } - - name: Add please-review label on command in issue comment uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/please-review')