Bump object_store from 0.12.4 to 0.13.1 #1207
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Label community PRs | |
| on: | |
| pull_request_target: | |
| types: [opened, reopened, synchronize] | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Label PRs from external contributors | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const labelName = 'community'; | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const pr = context.payload.pull_request; | |
| const prNumber = pr.number; | |
| const author = pr.user.login; | |
| const assoc = pr.author_association; // OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, NONE | |
| const existing = new Set((pr.labels || []).map(l => l.name)); | |
| core.info(`PR #${prNumber} by @${author}, author_association=${assoc}`); | |
| core.info(`Existing labels: ${Array.from(existing).join(', ') || '(none)'}`); | |
| // Internal authors shouldn't get "community" | |
| const isInternal = ['OWNER', 'MEMBER', 'COLLABORATOR'].includes(assoc); | |
| if (isInternal) { | |
| core.info('Internal author; not adding label.'); | |
| return; | |
| } | |
| // External contributors: add the label if not present | |
| if (existing.has(labelName)) { | |
| core.info(`"${labelName}" already present; nothing to do.`); | |
| return; | |
| } | |
| await github.rest.issues.addLabels({ | |
| owner, | |
| repo, | |
| issue_number: prNumber, | |
| labels: [labelName], | |
| }); | |
| core.info(`Added label "${labelName}" to PR #${prNumber}.`); |