Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label documentation #13

Merged
merged 8 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/add-gssoc-label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Auto Label PR

on:
pull_request:
types: [opened, reopened, synchronize]
types: [opened, reopened, synchronize,edited]

jobs:
label_pr:
Expand Down
77 changes: 46 additions & 31 deletions .github/workflows/auto-label-issues.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
name: Auto Label Issues

on:
issues:
types: [opened, edited]
types: [opened, reopened,edited]

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

name: "Auto Label"
on:
issues:
types: [opened, edited]
- name: Checkout
uses: actions/checkout@v3

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Apply 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.name,
labels: ['GSSoC']
})

.github/labeler.yml:
GSSOC:
- '.*'
documentation:
- '.README.'
- '.docs.'
enhancement:
- '.feature.'
- '.enhance.'
bug:
- '.bug.'
- '.fix.'
- '.issue.'
- name: Categorize issue
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue = context.payload.issue;
const title = issue.title.toLowerCase();
const body = issue.body.toLowerCase();

let labels = [];

if (title.includes('doc') || body.includes('doc') || title.includes('readme') || body.includes('readme')) {
labels.push('documentation');
}

if (title.includes('feature') || body.includes('feature') || title.includes('enhance') || body.includes('enhance')) {
labels.push('enhancement');
}

if (title.includes('bug') || body.includes('bug') || title.includes('fix') || body.includes('fix')) {
labels.push('bug');
}

if (labels.length > 0) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.name,
labels: labels
});
}
Loading