mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Merge pull request #1279 from microsoft/StellaHuang95-patch-1
Create auto-label.yml
This commit is contained in:
commit
9442a22e6c
1 changed files with 39 additions and 0 deletions
39
.github/workflows/auto-label.yml
vendored
Normal file
39
.github/workflows/auto-label.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: Auto-label when user responds
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
env:
|
||||
TRIAGERS: '["int19h","karthiknadig","ericsnowcurrently","fabioz", "gramster", "StellaHuang95", "AdamYoblick"]'
|
||||
|
||||
jobs:
|
||||
run-check:
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(github.event.issue.labels.*.name, 'waiting for response') && !contains(github.event.issue.labels.*.name, 'user responded')
|
||||
steps:
|
||||
- name: Add/Remove labels when user responds
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const payload = context.payload;
|
||||
const commentAuthor = payload.comment.user.login;
|
||||
const isTeamMember = ${{ env.TRIAGERS }}.includes(commentAuthor);
|
||||
if (!isTeamMember) {
|
||||
const issue_number = payload.issue.number;
|
||||
await github.rest.issues.removeLabel({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue_number,
|
||||
name: 'waiting for response'
|
||||
});
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue_number,
|
||||
labels: ['user responded']
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue