Add workflow for automated dependency updates

This commit is contained in:
James Collins
2026-01-01 06:56:13 +10:00
committed by GitHub
parent ca025ca2e8
commit a65f0eead6

55
.github/workflows/dependency-update.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: Dependency update
on:
schedule:
- cron: "0 20 * * 1" # Mondays 20:00 UTC
workflow_dispatch: {}
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
tools: composer:v2
- name: Install current deps
run: |
npm ci
composer install --no-interaction --no-progress
- name: Update deps
run: |
npm update
composer update --no-interaction --no-progress
- name: Detect changes
id: changes
run: |
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create PR
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Dependency update"
title: "Dependency update"
body: "Automated dependency update."
branch: "bot/dependency-update"
delete-branch: true