Skip to content

Commit

Permalink
Merge pull request #17 from Anjaliavv51/code-changes
Browse files Browse the repository at this point in the history
Code changes
  • Loading branch information
Anjaliavv51 authored Jul 29, 2024
2 parents b644674 + 0c9bde7 commit 62ef304
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/add-gssoc-label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ jobs:
const prBody = pr.body ? pr.body.toLowerCase() : '';
const prTitle = pr.title.toLowerCase();
// Add gssoc label to all PRs
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['gssoc']
});
const addLabel = async (label) => {
await github.rest.issues.addLabels({
owner: context.repo.owner,
Expand All @@ -35,18 +27,19 @@ jobs:
labels: [label]
});
};
// Check for documentation changes
if (prBody.includes('documentation') || prTitle.includes('doc') || prBody.includes('readme')) {
await addLabel('documentation');
}
// Check for enhancements
if (prBody.includes('feature') || prBody.includes('enhancement') || prTitle.includes('add') || prTitle.includes('implement')) {
await addLabel('enhancement');
}
// Check for bugs
if (prBody.includes('bug') || prBody.includes('fix') || prTitle.includes('fix') || prTitle.includes('resolve')) {
await addLabel('bug');
}
if (prBody.includes('gssoc')) {
await addLabel('gssoc');
}
19 changes: 5 additions & 14 deletions .github/workflows/auto-label-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ jobs:
const issue = context.payload.issue;
const issueBody = issue.body ? issue.body.toLowerCase() : '';
const issueTitle = issue.title.toLowerCase();
// Add gssoc label to all issues
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ['gssoc']
});
const addLabel = async (label) => {
await github.rest.issues.addLabels({
owner: context.repo.owner,
Expand All @@ -35,18 +26,18 @@ jobs:
labels: [label]
});
};
// Check for documentation changes
if (issueBody.includes('documentation') || issueTitle.includes('doc') || issueBody.includes('readme')) {
await addLabel('documentation');
}
// Check for enhancements
if (issueBody.includes('feature') || issueBody.includes('enhancement') || issueTitle.includes('add') || issueTitle.includes('implement')) {
await addLabel('enhancement');
}
// Check for bugs
if (issueBody.includes('bug') || issueBody.includes('fix') || issueTitle.includes('fix') || issueTitle.includes('resolve')) {
await addLabel('bug');
}
if (prBody.includes('gssoc')) {
await addLabel('gssoc');
}

0 comments on commit 62ef304

Please sign in to comment.