Demo Issue #1
This file contains 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: Add Labels to New Issues | |
on: | |
issues: | |
types: | |
- opened | |
jobs: | |
add_labels: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Add labels to issue | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
const labelsToAdd = ["hacktoberfest"]; // Add your desired labels here | |
const issue = github.context.payload.issue; | |
const owner = issue.repository.owner.login; | |
const repo = issue.repository.name; | |
await github.issues.addLabels({ | |
owner, | |
repo, | |
issue_number: issue.number, | |
labels: labelsToAdd, | |
}); | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |