forked from PrestaShop/PrestaShop
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (64 loc) · 2.22 KB
/
cron_php_update_modules.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
name: Cron Update PHP Modules
on:
schedule:
- cron: '0 23 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
update-composer-modules:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
runs-on: ubuntu-latest
name: Update PHP Modules
strategy:
fail-fast: false
matrix:
BRANCH:
- develop
- 9.0.x
- 8.2.x
env:
GH_BRANCH: ${{ matrix.BRANCH }}
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.GH_BRANCH }}
- name: Install Composer dependencies
run: |
composer self-update --stable
COMPOSER_PROCESS_TIMEOUT=600 composer install --ansi --prefer-dist --no-interaction --no-progress
- name: Execute script for updating modules
run: php .github/workflows/cron_update_modules/script.php ${{ env.GH_BRANCH }}
- name: Update PrestaShop packages
id: updated-packages
run: |
if [[ -f cron_php_update_modules.txt ]]; then
FILE_CONTENT=$(cat cron_php_update_modules.txt)
echo PR_BODY=$FILE_CONTENT >> $GITHUB_OUTPUT
rm cron_php_update_modules.txt
else
echo 'Nothing to update'
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
if: ${{steps.updated-packages.outputs.PR_BODY}} != ''
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: cron-php-update-modules-${{ env.GH_BRANCH }}
commit-message: Updated PrestaShop Packages
committer: PrestonBot <[email protected]>
author: prestonBot <[email protected]>
title: 'Updated PrestaShop Packages'
body: ${{steps.updated-packages.outputs.PR_BODY}}
base: ${{ env.GH_BRANCH }}
delete-branch: true