chore: cleanup unused packages and update setup #1
Workflow file for this run
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: Contributor Label | |
| on: | |
| pull_request_target: | |
| types: [opened, reopened] | |
| permissions: | |
| issues: write | |
| pull-requests: read | |
| jobs: | |
| label: | |
| name: Add contributor label | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| let permission = 'none'; | |
| try { | |
| const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ | |
| owner, | |
| repo, | |
| username: context.payload.pull_request.user.login, | |
| }); | |
| permission = data.permission; | |
| } catch (error) { | |
| if (error.status !== 404) { | |
| throw error; | |
| } | |
| } | |
| if ( | |
| !['MEMBER', 'OWNER'].includes(context.payload.pull_request.author_association) && | |
| !['admin', 'maintain', 'write'].includes(permission) | |
| ) { | |
| return; | |
| } | |
| await github.rest.issues.addLabels({ | |
| owner, | |
| repo, | |
| issue_number: context.issue.number, | |
| labels: ['Contributor: Internal'], | |
| }); |