Skip to content

[New API] : Quotes REST API #236

[New API] : Quotes REST API

[New API] : Quotes REST API #236

Workflow file for this run

name : Adding cool Tags to issues
on:
issues:
types:
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
steps:
- name: Adding cool Tags
uses: actions/github-script@v6
with:
github-token: ${{ secrets.APIVerse_SECRET }}
script: |
const { owner, repo, number } = context.issue;
const title = context.payload.issue.title;
console.log(title);
let coolTags = [];
if(title && title.toLowerCase().includes('new api'))
{
coolTags.push('awesome');
coolTags.push('newapi');
coolTags.push('gssoc');
coolTags.push('level3');
}
if(title && title.toLowerCase().includes('api enhancement'))
{
coolTags.push('wow');
coolTags.push('enhancement');
coolTags.push('gssoc');
coolTags.push('level2');
}
if(title && title.toLowerCase().includes('existing api name'))
{
coolTags.push('wow');
coolTags.push('existing-api');
coolTags.push('gssoc');
coolTags.push('level2');
}
if(title && title.toLowerCase().includes('documentation error'))
{
coolTags.push('good');
coolTags.push('documentation');
coolTags.push('gssoc');
coolTags.push('level1');
}
console.log(coolTags.length);
if (coolTags.length > 0) {
github.rest.issues.addLabels({
issue_number: number,
owner: owner,
repo: repo,
labels: coolTags
});
console.log(`Added cool labels`);
}
else{
console.log('No tags');
}