Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update issue-labels.yml #517

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 17 additions & 23 deletions .github/workflows/issue-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,30 @@ on:
issues:
types: [opened, reopened]

env:
TRIAGERS: '["karthiknadig","eleanorjboyd","anthonykim1"]'

permissions:
issues: write

jobs:
# From https://github.com/marketplace/actions/github-script#apply-a-label-to-an-issue.
add-triage-label:
name: "Add 'triage-needed'"
add-classify-label:
name: "Add 'triage-needed' and remove assignees"
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
- name: Checkout Actions
uses: actions/checkout@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const result = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const labels = result.data.map((label) => label.name)
const hasNeeds = labels.some((label) => label.startsWith('needs'))
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

if (!hasNeeds) {
console.log('This issue is not labeled with a "needs __" label, add the "triage-needed" label.')
- name: Install Actions
run: npm install --production --prefix ./actions

github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['triage-needed']
})
} else {
console.log('This issue already has a "needs __" label, do not add the "triage-needed" label.')
}
- name: "Add 'triage-needed' and remove assignees"
uses: ./actions/python-issue-labels
with:
triagers: ${{ env.TRIAGERS }}
token: ${{secrets.GITHUB_TOKEN}}
Loading