-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (46 loc) · 1.43 KB
/
processor.yml
File metadata and controls
59 lines (46 loc) · 1.43 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Process OpenAPI Files
on:
push:
branches:
- main
- stage
paths:
- 'openapi/**'
workflow_dispatch: # Allows the action to be triggered manually
jobs:
process_openapi_files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq yq nodejs npm
- name: Install Mintlify Scrape
run: npm install @mintlify/scraping@latest -g
- name: Add servers if required
run: bash ./scripts/add_servers.sh
- name: Run the OpenAPI script
run: |
chmod +x ./scripts/process_docs.sh
./scripts/process_docs.sh
- name: Docs output
run: |
echo "The JSON array output from the script is: $docs_output"
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
fi
git commit -m "Update docs.json with new OpenAPI data"
# Pull latest and rebase our commit on top
git pull --rebase origin ${GITHUB_REF_NAME}
# Push after successful rebase
git push origin ${GITHUB_REF_NAME}