-
-
Notifications
You must be signed in to change notification settings - Fork 26
74 lines (66 loc) · 2.58 KB
/
update-generated.yml
File metadata and controls
74 lines (66 loc) · 2.58 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
69
70
71
72
73
74
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: MIT
name: Update generated files
on:
push:
branches:
- renovate/**
- main
pull_request:
permissions:
contents: write
jobs:
submodule-update:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
if: github.event_name != 'pull_request'
with:
token: ${{ secrets.WEBLATE_CI_TOKEN }}
submodules: true
persist-credentials: true
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
if: github.event_name == 'pull_request'
with:
submodules: true
persist-credentials: false
- run: sudo apt-get update
- run: sudo apt-get install -y gettext
- name: Setup Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@eb1897b8dc4b5d5bfe39a428a8f2304605e0983c # v7.0.0
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install dependencies
run: uv pip install --system -e .[dev]
- run: make
- run: git diff
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
if: github.event_name == 'pull_request' && github.actor != 'renovate[bot]'
with:
msg: 'chore: update generated files'
- name: Update current branch
if: github.event_name == 'push' && github.ref_name != 'main'
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
with:
commit_message: 'chore: update generated files'
- name: Create Pull Request
id: cpr
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.ref_name == 'main'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
branch: create-pull-request/submodule-update
title: 'chore: update generated files'
commit-message: 'chore: update generated files'
token: ${{ secrets.WEBLATE_CI_TOKEN }}
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation && steps.cpr.outputs.pull-request-operation != 'none'
run: gh pr merge --rebase --auto "$PR_NUMBER"
env:
GH_TOKEN: ${{ secrets.WEBLATE_CI_TOKEN }}
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}