Skip to content

Commit

Permalink
feat: GitHub Actions Improve triage (jhipster#12641)
Browse files Browse the repository at this point in the history
This improves the GitHub triage action to check if labels already exist.
  • Loading branch information
pascalgrimaud authored Oct 4, 2020
1 parent 14ffdc3 commit 08aae8c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,22 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue = { owner: context.issue.owner, repo: context.issue.repo, issue_number: context.issue.number }
github.issues.addLabels({...issue, labels: ['area: triage', 'theme: undefined']})
github.issues.listLabelsOnIssue({...issue}).then(response => {
const labels = response.data
let missingLabel = [], missingArea = true, missingTheme = true
for (const label of labels) {
if (label.name.includes('area: ')) {
missingArea = false
}
if (label.name.includes('theme: ')) {
missingTheme = false
}
}
if (missingArea) {
missingLabel.push('area: triage')
}
if (missingTheme) {
missingLabel.push('theme: undefined')
}
github.issues.addLabels({...issue, labels: missingLabel})
})

0 comments on commit 08aae8c

Please sign in to comment.