FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Verified Commit 2597be7f authored by Sebastiaan ten Pas's avatar Sebastiaan ten Pas
Browse files

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

parent 2e101441
No related branches found
No related tags found
No related merge requests found
Pipeline #721730 passed
---
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.
......@@ -206,6 +206,7 @@ nav:
- howtos/renovatebot/trigger-renovatebot-from-gitlab-ui.md
- howtos/renovatebot/trigger-renovatebot-from-cli.md
- howtos/renovatebot/trigger-renovatebot-from-ci.md
- howtos/renovatebot/post-upgrade-tasks.md
- "Tutorials":
- tutorials/index.md
- tutorials/automating-gitlab-releases.md
......
[tool.poe.tasks.fix]
help = "Run pre-commit checks to fix formatting errors"
cmd = "pre-commit run --all-files"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment