FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

feat(renovatebot): add page about running post-upgrade tasks

Merged Sebastiaan ten Pas requested to merge renovatebot-post-upgrade-tasks into master
1 unresolved thread
3 files
+ 53
0
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 49
0
---
title: Post-upgrade tasks
---
# Running post-upgrade tasks
[Post-upgrade tasks](https://docs.renovatebot.com/configuration-options/#postupgradetasks) that are
executed before a commit is made by Renovate.
Post-upgrade tasks are commands that are executed by Renovate after a dependency has been updated
but before the commit is created. The intention is to run any other command line tools that would
modify existing files or generate new files when a dependency changes.
Each command must match at least one of the patterns defined in allowedCommands (a global-only
configuration option) in order to be executed.
[Our configuration](https://gitlab.developers.cam.ac.uk/uis/devops/infra/gitlab-bots-deployment/-/blob/main/renovatebot-config.js?ref_type=heads#L97)
is set up such that it can call scripts in the `./.renovate/` directory in the root that start with `post-upgrade*`.
Examples usages:
{% raw %}
```json
"postUpgradeTasks": {
"commands": [
"./.renovate/post-upgrade.py '{{{ toJSON upgrades }}}'"
],
"executionMode": "branch",
"fileFilters": ["CHANGELOG.md"]
}
```
{% endraw %}
Or:
{% raw %}
```json
"postUpgradeTasks": {
"commands": [
".renovate/post-upgrade.sh \"{{{depName}}}\" \"{{{currentVersion}}}\" \"{{{newVersion}}}\""
],
"fileFilters": ["CHANGELOG.md"]
}
```
{% endraw %}
Note: make sure that the script is executable.
Loading