Check for Composer Updates #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |