-
Notifications
You must be signed in to change notification settings - Fork 216
46 lines (39 loc) · 1.61 KB
/
Copy pathapi-docs.yml
File metadata and controls
46 lines (39 loc) · 1.61 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
name: Update Crowdin API Docs
on:
schedule:
- cron: "0 14 * * *" # Run every day at 14:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-api-docs:
if: github.repository == 'crowdin/docs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Download Crowdin API docs
run: |
USER_AGENT="crowdin-docs-updater/1.0"
download() {
curl --fail --show-error --silent --user-agent "$USER_AGENT" -o "$1" "$2"
}
download src/assets/api/crowdin/file-based.yml https://api.crowdin.com/api/docs/rest/file-based.yaml
download src/assets/api/enterprise/file-based.yml https://enterprise.api.crowdin.com/api/docs/rest/file-based.yaml
download src/assets/api/crowdin/string-based.yml https://api.crowdin.com/api/docs/rest/string-based.yaml
download src/assets/api/enterprise/string-based.yml https://enterprise.api.crowdin.com/api/docs/rest/string-based.yaml
- name: Check for changes
id: check_changes
run: |
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(developer): update API docs"
title: "chore(developer): update API docs"
body: This automated PR updates the Crowdin API documentation files.
branch: update-crowdin-api-docs
base: main
labels: API