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: Auto Add Issue Labels | |
| on: | |
| issues: | |
| types: | |
| - opened | |
| permissions: | |
| issues: write | |
| jobs: | |
| add-labels: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add default Labels to new issues | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const labelsToAdd = ['needs/validation', 'needs/refinement']; | |
| const { owner, repo } = context.repo; | |
| await github.rest.issues.addLabels({ | |
| owner, | |
| repo, | |
| issue_number: context.issue.number, | |
| labels: labelsToAdd | |
| }); |