Skip to content
Snippets Groups Projects
Commit 6a95024e authored by Rhys Arkins's avatar Rhys Arkins
Browse files

feat!: allow post upgrade templating by default (#21326)

Closes #21320

BREAKING CHANGE: Post upgrade templating is now allowed by default, as long as the post upgrade task command is itself already allowed.
parent 519fe4cc
Branches
No related tags found
No related merge requests found
...@@ -19,15 +19,10 @@ Please also see [Self-Hosted Experimental Options](./self-hosted-experimental.md ...@@ -19,15 +19,10 @@ Please also see [Self-Hosted Experimental Options](./self-hosted-experimental.md
## allowPostUpgradeCommandTemplating ## allowPostUpgradeCommandTemplating
Set to `true` to allow templating of dependency level post-upgrade commands.
Let's look at an example of configuring packages with existing Angular migrations. Let's look at an example of configuring packages with existing Angular migrations.
Add two properties to `config.js`: `allowPostUpgradeCommandTemplating` and `allowedPostUpgradeCommands`:
```javascript ```javascript
module.exports = { module.exports = {
allowPostUpgradeCommandTemplating: true,
allowedPostUpgradeCommands: ['^npm ci --ignore-scripts$', '^npx ng update'], allowedPostUpgradeCommands: ['^npm ci --ignore-scripts$', '^npx ng update'],
}; };
``` ```
...@@ -60,6 +55,9 @@ npm ci --ignore-scripts ...@@ -60,6 +55,9 @@ npm ci --ignore-scripts
npx ng update @angular/core --from=10.0.0 --to=11.0.0 --migrate-only --allow-dirty --force npx ng update @angular/core --from=10.0.0 --to=11.0.0 --migrate-only --allow-dirty --force
``` ```
If you wish to disable templating because of any security or performance concern, you may set `allowPostUpgradeCommandTemplating` to `false`.
But before you disable templating completely, try the `allowedPostUpgradeCommands` config option to limit what commands are allowed to run.
## allowScripts ## allowScripts
## allowedPostUpgradeCommands ## allowedPostUpgradeCommands
......
...@@ -24,9 +24,9 @@ const options: RenovateOptions[] = [ ...@@ -24,9 +24,9 @@ const options: RenovateOptions[] = [
{ {
name: 'allowPostUpgradeCommandTemplating', name: 'allowPostUpgradeCommandTemplating',
description: description:
'Set this to `true` to allow templating for post-upgrade commands.', 'Set this to `false` to disable template compilation for post-upgrade commands.',
type: 'boolean', type: 'boolean',
default: false, default: true,
globalOnly: true, globalOnly: true,
}, },
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment