[Suspicious Plugin Activity] OctoPrint-BedCheckAI #197
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: "Issue Labeler" | |
on: | |
issues: | |
types: [opened, edited] | |
jobs: | |
apply-label: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
let labels = []; | |
if (context.payload.issue.title.match(/\[abandoned plugin\]/i)) { | |
labels.push('abandoned plugin'); | |
labels.push('needs review'); | |
} | |
if (context.payload.issue.title.match(/\[suspicious plugin activity\]/i)) { | |
labels.push('suspicious plugin activity'); | |
labels.push('needs review'); | |
} | |
if (context.payload.issue.title.match(/\[listing error\]/i)) { | |
labels.push('listing error'); | |
labels.push('needs review'); | |
} | |
if (labels.length > 0) { | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: labels | |
}) | |
} |