-
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 1.8 KB
/
Copy pathupdate.yml
File metadata and controls
68 lines (55 loc) · 1.8 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
60
61
62
63
64
65
66
67
68
name: Update Schema
on:
schedule:
# Run weekly on Sundays at 8:00 AM UTC
- cron: '0 8 * * 0'
workflow_dispatch: # Allow manual trigger
jobs:
update-schema:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Update docs SHA
run: npm run update-docs
- name: Install dependencies
run: npm ci
- name: Generate new schema
run: npm run generate
- name: Format
run: npm run format
- name: Check for changes
id: check-changes
run: |
if git diff --quiet dist/schema.json config.json; then
echo "has-changes=false" >> $GITHUB_OUTPUT
else
echo "has-changes=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check-changes.outputs.has-changes == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.PAT }}
commit-message: 'Update docs SHA and regenerate OpenAPI schema'
title: 'Update docs SHA and regenerate OpenAPI schema'
body: |
This PR was automatically generated by the weekly schema update workflow.
Changes include:
- Updated mastodon/documentation commit SHA to latest
- Regenerated OpenAPI schema based on the latest Mastodon documentation
Please review the changes and merge if they look correct.
branch: update-schema
delete-branch: true