Skip to content

Commit

Permalink
Update auto-label-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjaliavv51 authored Jul 31, 2024
1 parent a5a2d6d commit f561d2d
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/auto-label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,31 @@ jobs:
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
});
}

0 comments on commit f561d2d

Please sign in to comment.