placementt-core 1.400.957 → 1.400.959
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Sync PR status to ClickUp
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, closed]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
sync-clickup:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- name: Extract ClickUp Task ID
|
|
13
|
+
id: extract
|
|
14
|
+
run: |
|
|
15
|
+
# Try branch name first (format: CU-{taskId}_title)
|
|
16
|
+
TASK_ID=$(echo "${{ github.head_ref }}" | grep -oE 'CU-[a-zA-Z0-9]+' | head -1 | sed 's/CU-//')
|
|
17
|
+
# Fall back to PR title (format: "CU-{taskId}" or "Cu {taskId}")
|
|
18
|
+
if [ -z "$TASK_ID" ]; then
|
|
19
|
+
TASK_ID=$(echo "${{ github.event.pull_request.title }}" | grep -oiE '(CU-[a-zA-Z0-9]+|Cu [a-zA-Z0-9]+)' | head -1 | sed 's/^[Cc][Uu][-\ ]*//')
|
|
20
|
+
fi
|
|
21
|
+
echo "TASK_ID=$TASK_ID" >> $GITHUB_ENV
|
|
22
|
+
|
|
23
|
+
# 👉 When PR is opened → set to "In Review"
|
|
24
|
+
- name: Set status to In Review
|
|
25
|
+
if: github.event.action == 'opened' && env.TASK_ID != ''
|
|
26
|
+
run: |
|
|
27
|
+
curl -X PUT "https://api.clickup.com/api/v2/task/$TASK_ID" \
|
|
28
|
+
-H "Authorization: ${{ secrets.CLICKUP_API_KEY }}" \
|
|
29
|
+
-H "Content-Type: application/json" \
|
|
30
|
+
-d '{"status":"In review"}'
|
|
31
|
+
|
|
32
|
+
# 👉 When PR is merged → set to "Done"
|
|
33
|
+
- name: Set status to Done
|
|
34
|
+
if: github.event.action == 'closed' && github.event.pull_request.merged == true && env.TASK_ID != ''
|
|
35
|
+
run: |
|
|
36
|
+
curl -X PUT "https://api.clickup.com/api/v2/task/$TASK_ID" \
|
|
37
|
+
-H "Authorization: ${{ secrets.CLICKUP_API_KEY }}" \
|
|
38
|
+
-H "Content-Type: application/json" \
|
|
39
|
+
-d '{"status":"complete"}'
|
|
40
|
+
|
|
41
|
+
# 👉 When PR is merged → resolve linked errors in Firebase
|
|
42
|
+
- name: Resolve errors in Firebase
|
|
43
|
+
if: github.event.action == 'closed' && github.event.pull_request.merged == true && env.TASK_ID != ''
|
|
44
|
+
continue-on-error: true
|
|
45
|
+
run: |
|
|
46
|
+
curl -X POST "https://europe-west2-placementt-dev.cloudfunctions.net/errorLogging-resolveErrorsByClickupTask" \
|
|
47
|
+
-H "Content-Type: application/json" \
|
|
48
|
+
-d "{\"clickupTaskId\":\"$TASK_ID\"}"
|