Updation in index file #58
Workflow file for this run
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: Auto Label PRs | |
on: | |
pull_request: | |
types: [opened, edited] | |
jobs: | |
label_pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/labeler@v4 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
configuration-path: .github/labeler.yml | |
- name: Add GSSOC label | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['gssoc'] | |
}) | |
- name: Add additional labels based on title | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const title = context.payload.pull_request.title.toLowerCase(); | |
const labelsToAdd = []; | |
if (title.includes('documentation')) { | |
labelsToAdd.push('documentation'); | |
} | |
if (title.includes('feature')) { | |
labelsToAdd.push('feature'); | |
} | |
if (title.includes('bug')) { | |
labelsToAdd.push('bug'); | |
} | |
if (labelsToAdd.length > 0) { | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: labelsToAdd | |
}); | |
} |