-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (40 loc) · 1.31 KB
/
sync.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
name: sync-openapi
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.x'
- name: Install yq
run: |
YQ_VERSION=v4.44.1
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O yq
chmod +x yq
mv yq /usr/local/bin
- name: Sync Docs
run: |
bash -x tools/sync-openapi.sh
- name: Commit and push changes
run: |
if [[ `git status --porcelain` ]]; then
# Changes
echo "Changes detected"
else
# No changes
echo "No changes detected"
exit 0
fi
git config --global user.name 'qdrant'
git config --global user.email 'qdrant@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git add fern/apis
git add fern/versions
git add fern/docs.yml
git commit -am "auto-sync openapi with qdrant core" && git push || true