Skip to content

Commit e0280e6

Browse files
committed
Added Github Action to call Vector Webhook Url
1 parent 03d6b9c commit e0280e6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docs to Vector
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
- docs-to-vector
9+
10+
env:
11+
TARGET_BRANCH: ${{ github.ref_name }}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Connect Tailscale
18+
# if branch is not master
19+
if: ${{ github.ref_name != 'master' }}
20+
uses: tailscale/github-action@v3
21+
with:
22+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
23+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
24+
tags: tag:ci
25+
26+
- name: Call Webhook
27+
run: |
28+
WEBHOOK_URL=${{ secrets.VECTOR_WEBHOOK_URL }}
29+
if [ "${{ env.TARGET_BRANCH }}" != "master" ]; then
30+
WEBHOOK_URL=${{ secrets.VECTOR_WEBHOOK_URL_PREVIEW }}
31+
fi
32+
curl -X POST \
33+
-H "Content-Type: application/json" \
34+
-d '{"commit_id": "${{ github.sha }}", "branch": "${{ github.ref_name }}"}' \
35+
${WEBHOOK_URL}

0 commit comments

Comments
 (0)