-
Notifications
You must be signed in to change notification settings - Fork 17
37 lines (32 loc) · 1.69 KB
/
move-clickup-task.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
name: Move ClickUp Task to CODE REVIEW and Add PR Link as Comment
on:
pull_request:
types: [opened, closed]
jobs:
update_task_status:
runs-on: ubuntu-latest
steps:
- name: Extract ClickUp Task ID from PR Title
id: extract_task_id
run: echo "::set-output name=task_id::$(echo ${{ github.event.pull_request.title }} | grep -o '[a-zA-Z0-9]\{9\}')"
- name: Move Task to CODE REVIEW
if: github.event.action == 'opened' && steps.extract_task_id.outputs.task_id != ''
run: |
curl -X PUT "https://api.clickup.com/api/v2/task/${{ steps.extract_task_id.outputs.task_id }}" \
-H "Authorization: ${{ secrets.CLICKUP_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"status": "CODE REVIEW"}'
- name: Add PR Link as Comment
if: github.event.action == 'opened' && steps.extract_task_id.outputs.task_id != ''
run: |
curl -X POST "https://api.clickup.com/api/v2/task/${{ steps.extract_task_id.outputs.task_id }}/comment" \
-H "Authorization: ${{ secrets.CLICKUP_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"comment_text": "PR: ${{ github.event.pull_request.html_url }}", "notify_all": false }'
- name: Move Task to READY FOR PUBLISHING
if: github.event.action == 'closed' && github.event.pull_request.merged == true && steps.extract_task_id.outputs.task_id != ''
run: |
curl -X PUT "https://api.clickup.com/api/v2/task/${{ steps.extract_task_id.outputs.task_id }}" \
-H "Authorization: ${{ secrets.CLICKUP_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"status": "READY FOR PUBLISHING"}'