https://github.com/valicm/drupal-update
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.
https://github.com/valicm/drupal-update
composer dependency-manager drupal drupal-10 drupal-project drupal-update drupal-upgrade drupal10
Last synced: 7 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/valicm/drupal-update
- Owner: valicm
- License: gpl-3.0
- Created: 2023-10-29T21:24:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T22:45:01.000Z (about 2 years ago)
- Last Synced: 2025-06-27T20:43:27.242Z (7 months ago)
- Topics: composer, dependency-manager, drupal, drupal-10, drupal-project, drupal-update, drupal-upgrade, drupal10
- Language: Shell
- Homepage: https://vallic.com
- Size: 27.3 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Description
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.
## Features
* 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
* highlight failed patches
* can be used as a GitHub action
* can be used as a standalone script.
## Notes
* supported update type modes are `semver-safe-update` and `all`. `All` represents full upgrade between major core versions.
* Semver necessarily does not mean minor versions only (etc 2.1.0, 2.1.2).
* If you requested package as `^11.0`, any release as `^11.5` is considered by this script as `minor`.
* The provided patch failures could be in some scenarios false-positive.
* This tool is not providing a one click upgrade - review release notes for each module, etc.
## GitHub Action Usage

See [action.yml](action.yml)
```yaml
steps:
- uses: actions/checkout@v2
- name: Check updates
id: updates
uses: valicm/drupal-update@v4
```
### GitHub action example to create PR with updates
* 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)_
```yaml
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@v4
- 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
```
## Standalone script usage

| 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` |
Get all minor updates and output results in summary.md file.
```bash
curl -fsSL https://raw.githubusercontent.com/valicm/drupal-update/main/drupal-update.sh | bash -s -- -o summary.md
```