-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (41 loc) · 1.65 KB
/
claim.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
34
35
36
37
38
39
40
41
# Workflow borrowed from covid19india/covid19india-react
on:
issue_comment:
types: [created]
name: Claim Issue
jobs:
assign:
name: Update labels and Assign
if: github.event.issue.pull_request == ''
&& contains(github.event.comment.body, '/claim')
&& contains(toJson(github.event.issue.labels), 'Available')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@0.9.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Status: Claimed']
})
await github.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Status: Available'
})
await github.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: [context.payload.sender.login]
})
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thank you @'+context.payload.sender.login+' for claiming this issue! 🎉 \n\nPlease reference this issue when you submit your Pull Request and make sure you follow the [contributing guidelines](https://github.com/epispot/EpiJS/blob/main/CONTRIBUTING.md).'
})