Skip to content

Commit 04494ef

Browse files
ci: automated API docs update (#214)
1 parent afb348e commit 04494ef

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/api-docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Update Crowdin API Docs
2+
3+
on:
4+
schedule:
5+
- cron: '0 12 * * *' # Run every day at 12:00 UTC
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update-api-docs:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Download Crowdin API docs
20+
run: |
21+
curl -o src/assets/api/crowdin/file-based.yml https://api.crowdin.com/api/docs/rest/file-based.yaml
22+
curl -o src/assets/api/enterprise/file-based.yml https://enterprise.api.crowdin.com/api/docs/rest/file-based.yaml
23+
curl -o src/assets/api/crowdin/string-based.yml https://api.crowdin.com/api/docs/rest/string-based.yaml
24+
curl -o src/assets/api/enterprise/string-based.yml https://enterprise.api.crowdin.com/api/docs/rest/string-based.yaml
25+
26+
- name: Check for changes
27+
id: check_changes
28+
run: |
29+
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
30+
31+
- name: Create Pull Request
32+
if: steps.check_changes.outputs.changes == 'true'
33+
uses: peter-evans/create-pull-request@v7
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
commit-message: "chore(developer): update API docs"
37+
title: "chore(developer): update API docs"
38+
body: This automated PR updates the Crowdin API documentation files.
39+
branch: update-crowdin-api-docs
40+
base: main

0 commit comments

Comments
 (0)