Skip to content

Commit

Permalink
Update auto-label-issues.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjaliavv51 authored Jul 29, 2024
1 parent ac53994 commit 5d6fde6
Showing 1 changed file with 33 additions and 28 deletions.
61 changes: 33 additions & 28 deletions .github/workflows/auto-label-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,40 @@ name: Auto Label Issues
on:
issues:
types: [opened, edited]

jobs:
label_issues:
auto-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/checkout@v2
- uses: actions/labeler@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue = context.payload.issue;
const title = issue.title.toLowerCase();
const body = issue.body.toLowerCase();
const labels = [];
if (title.includes('gssoc') || body.includes('gssoc')) {
labels.push('GSSoC');
}
if (title.includes('enhancement') || body.includes('enhancement')) {
labels.push('Enhancement');
}
if (title.includes('bug') || body.includes('bug')) {
labels.push('Bug');
}
if (title.includes('documentation') || body.includes('documentation')) {
labels.push('Documentation');
}
if (labels.length > 0) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.name,
labels: labels
});
}
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml

name: "Auto Label"
on:
issues:
types: [opened, edited]

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/labeler.yml:
GSSOC:
- '.*'
documentation:
- '.README.'
- '.docs.'
enhancement:
- '.feature.'
- '.enhance.'
bug:
- '.bug.'
- '.fix.'
- '.issue.'

0 comments on commit 5d6fde6

Please sign in to comment.