-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.32 KB
/
composer-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
name: Check for Composer Updates
on:
schedule:
- cron: '0 2 * * 1,2,3,4,5'
permissions:
issues: write
jobs:
check-updates:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: '8.2'
- name: Install Composer Dependencies
run: composer install --prefer-dist --no-progress
- name: Check for Composer Updates
id: composer_updates
run: |
composer update --dry-run --lock | grep -E "Upgrading|New version" > updates.txt || true
if [ -s updates.txt ]; then
echo "Updates found"
echo "updates=true" >> $GITHUB_ENV
else
echo "No updates found"
echo "updates=false" >> $GITHUB_ENV
fi
- name: Create Issue for Updates
if: env.updates == 'true'
uses: peter-evans/[email protected]
with:
title: "Composer Package Updates Available"
body: |
There are new updates available for Composer packages:
```
$(cat updates.txt)
```
Please consider running `composer update` to update the packages.
labels: "Meta: Composer Update"