-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
33 lines (31 loc) · 1.21 KB
/
needinfo-remove.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
name: Remove needinfo label
on:
issue_comment:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
if: |
contains(github.event.issue.labels.*.name, 'status: needs information') &&
github.event.comment.author_association != 'OWNER' &&
github.event.comment.author_association != 'MEMBER' &&
github.event.comment.author_association != 'COLLABORATOR'
permissions:
issues: write
pull-requests: write
steps:
# https://github.com/octokit/request-action/issues/118
- name: Remove needinfo label
run: |
curl --request DELETE \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/status%3A%20needs%20information' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}'
- name: Add answered label
run: |
curl --request POST \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--data '{"labels": ["status: answered"]}'