Skip to content

Commit 449b8a3

Browse files
committed
chore: record docs merge before Mintlify deploy
1 parent 2850efc commit 449b8a3

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/notify-teable-on-mintlify-deploy.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,30 @@ jobs:
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 15
1818
steps:
19+
- name: Record GitHub merge
20+
env:
21+
TEABLE_WEBHOOK_URL: ${{ secrets.TEABLE_WEBHOOK_URL }}
22+
TEABLE_WEBHOOK_TOKEN: ${{ secrets.TEABLE_WEBHOOK_TOKEN }}
23+
DOCS_BRANCH: ${{ github.event.pull_request.head.ref }}
24+
PR_NUMBER: ${{ github.event.pull_request.number }}
25+
PR_URL: ${{ github.event.pull_request.html_url }}
26+
MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
27+
MERGED_AT: ${{ github.event.pull_request.merged_at }}
28+
run: |
29+
set -euo pipefail
30+
curl -fsS -X POST \
31+
"$TEABLE_WEBHOOK_URL" \
32+
-H "Authorization: Bearer $TEABLE_WEBHOOK_TOKEN" \
33+
-H "Content-Type: application/json" \
34+
-d "$(jq -nc \
35+
--arg b "$DOCS_BRANCH" \
36+
--arg s "pending" \
37+
--arg p "$PR_NUMBER" \
38+
--arg r "$PR_URL" \
39+
--arg m "$MERGE_SHA" \
40+
--arg t "$MERGED_AT" \
41+
'{docs_branch:$b, mintlify_status:$s, pr_number:$p, pr_url:$r, merge_sha:$m, merged_at:$t}')"
42+
1943
- name: Wait for Mintlify deployment
2044
id: wait
2145
env:
@@ -88,6 +112,7 @@ jobs:
88112
PR_NUMBER: ${{ github.event.pull_request.number }}
89113
PR_URL: ${{ github.event.pull_request.html_url }}
90114
MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
115+
MERGED_AT: ${{ github.event.pull_request.merged_at }}
91116
run: |
92117
set -euo pipefail
93118
curl -fsS -X POST \
@@ -102,7 +127,8 @@ jobs:
102127
--arg p "$PR_NUMBER" \
103128
--arg r "$PR_URL" \
104129
--arg m "$MERGE_SHA" \
105-
'{docs_branch:$b, docs_url:$u, mintlify_status:$s, mintlify_deployment_id:$d, pr_number:$p, pr_url:$r, merge_sha:$m}')"
130+
--arg t "$MERGED_AT" \
131+
'{docs_branch:$b, docs_url:$u, mintlify_status:$s, mintlify_deployment_id:$d, pr_number:$p, pr_url:$r, merge_sha:$m, merged_at:$t}')"
106132
107133
- name: Fail if Mintlify did not deploy
108134
if: steps.wait.outputs.mintlify_status != 'success'

0 commit comments

Comments
 (0)