-
-
Notifications
You must be signed in to change notification settings - Fork 1k
62 lines (56 loc) · 1.82 KB
/
schema-update.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: jsonschema update
on:
push:
branches:
- deepsource-fix-**
- renovate/**
- main
paths:
- .github/workflows/schema-update.yml
- pyproject.toml
- docs/Makefile
permissions:
contents: read
jobs:
jsonschema-update:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.WEBLATE_CI_TOKEN }}
- uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Python dependencies
run: |
uv pip install --system $(sed -n 's/.*"\(weblate-schemas==\([^"]*\)\)".*/\1/p' pyproject.toml)
uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
- run: make -C docs update-schemas
- run: pre-commit run --files $(git diff --name-only)
continue-on-error: true
- name: Update renovate branch
if: github.ref != 'refs/heads/main'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'docs: Update JSON schemas'
- name: Create Pull Request
id: cpr
if: github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@v7
with:
branch: create-pull-request/jsonschema-update
title: 'docs: Update JSON schemas'
commit-message: 'docs: Update JSON schemas'
token: ${{ secrets.WEBLATE_CI_TOKEN }}
labels: |
dependencies
- name: Enable Pull Request Automerge
if: github.ref == 'refs/heads/main' && steps.cpr.outputs.pull-request-operation != 'none'
run: gh pr merge --rebase --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.WEBLATE_CI_TOKEN }}