mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
# Adapted from: https://github.com/microsoft/azure-pipelines-tasks/blob/master/.github/workflows/blank.yml
|
|
# This action labels and assigns newly opened issues
|
|
|
|
name: Issue triager
|
|
on:
|
|
issues:
|
|
types: [opened]
|
|
|
|
jobs:
|
|
label:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: damccorm/tag-ur-it@master
|
|
with:
|
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
configuration-path: "./triage-rules.yml"
|
|
|
|
- if: always()
|
|
uses: actions/github-script@0.4.0
|
|
with:
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
script: |
|
|
const issueLabels = await github.issues.listLabelsOnIssue({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo
|
|
});
|
|
|
|
const isAnnouncement = issueLabels.data && issueLabels.data
|
|
.map(label => label.name)
|
|
.includes('Announcement');
|
|
|
|
if (!isAnnouncement) {
|
|
github.issues.addLabels({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
labels: ['needs triage']
|
|
})
|
|
} |