97 lines (70 loc) · 3.08 KB
/
self-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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: self-update
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: Keys actualization and update status of translations
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
coverage: none
- name: Git setup
if: success()
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-progress --no-interaction
- name: Scanning packages
id: commit_packages
if: success()
run: |
IS_DIRTY=1
php app/packages.php
{ git add . && git commit -a -m "Updating package files"; } || IS_DIRTY=0
echo ::set-output name=is_dirty::${IS_DIRTY}
- name: Keys actualization
id: commit_keys
if: success()
run: |
IS_DIRTY=1
php app/keys.php
{ git add . && git commit -a -m "Updating translations keys"; } || IS_DIRTY=0
echo ::set-output name=is_dirty::${IS_DIRTY}
- name: Updating referents
id: referents
if: success()
run: |
IS_DIRTY=1
php app/referents.php
{ git add . && git commit -a -m "Updating the `docs/referents.md` file"; } || IS_DIRTY=0
echo ::set-output name=is_dirty::${IS_DIRTY}
- name: Checking for excludes
id: excludes
if: success()
run: |
IS_DIRTY=1
php app/excludes.php
{ git add . && git commit -a -m "Updating excludes files"; } || IS_DIRTY=0
echo ::set-output name=is_dirty::${IS_DIRTY}
- name: Status update
id: commit_status
if: success()
run: |
IS_DIRTY=1
php app/status.php
{ git add . && git commit -a -m "Updated status of translations"; } || IS_DIRTY=0
echo ::set-output name=is_dirty::${IS_DIRTY}
- name: Push changes
uses: ad-m/github-push-action@master
if: success() && (steps.commit_packages.outputs.is_dirty == 1 || steps.commit_keys.outputs.is_dirty == 1 || steps.referents.outputs.is_dirty == 1 || steps.excludes.outputs.is_dirty == 1 || steps.commit_status.outputs.is_dirty == 1)
with:
github_token: ${{ secrets.GITHUB_TOKEN }}