You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Drupal Composer updates
v2
Bash script for updating Drupal core and/or contributed modules with Composer. It can be used as a GitHub action or as a standalone script/integrated into other CI tools.
- perform minor or major updates to Drupal core / contributed modules
- options to exclude modules from check and/or enable Drupal core checks
- outputs Markdown table of changes as a file or environment variable
- can be used as a GitHub action
- can be used as a standalone script.
See action.yml
steps:
- uses: actions/checkout@v2
- name: Check updates
id: updates
uses: valicm/drupal-update@v2
- Runs each day once at midnight.
- Perform minor/security updates
- Creates automated PR with branch
drupal-automated-updates
(you need to set secret variable named MY_PERSONAL_TOKEN in your repo, so that PR can be created)
name: Automated Drupal updates
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
check-available-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check updates
id: updates
uses: valicm/drupal-update@v2
- name: create pull-request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MY_PERSONAL_TOKEN }}
commit-message: Automated Drupal updates
title: Automated Drupal updates
body: ${{ env.DRUPAL_UPDATES_TABLE }}
branch: drupal-automated-updates
delete-branch: true
Example | Command |
---|---|
Run all minor and security updates | bash drupal-update.sh |
Run any update (minor, security, major) | bash drupal-update.sh -t all |
Run any update, except for Drupal core | bash drupal-update.sh -t all -c false |
Run minor update, excluding some modules | bash drupal-update.sh -e pathauto,redirect |
Run all updates, saving summary in upgrade.md | bash drupal-update.sh -t all -o upgrade.md |