[New API] : WorldTimeAPI #240
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
} |