Skip to content

Commit

Permalink
feat!: allow post upgrade templating by default (#21326)
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <[email protected]>
  • Loading branch information
rarkins and HonkingGoose authored Apr 5, 2023
1 parent fb71c81 commit d11731c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,7 @@ The `postUpgradeTasks` configuration consists of three fields:

A list of commands that are executed after Renovate has updated a dependency but before the commit is made.

You can use variable templating in your commands if [`allowPostUpgradeCommandTemplating`](https://docs.renovatebot.com/self-hosted-configuration/#allowpostupgradecommandtemplating) is enabled.
You can use variable templating in your commands as long as [`allowPostUpgradeCommandTemplating`](https://docs.renovatebot.com/self-hosted-configuration/#allowpostupgradecommandtemplating) is enabled.

### fileFilters

Expand Down
8 changes: 3 additions & 5 deletions docs/usage/self-hosted-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@ Please also see [Self-Hosted Experimental Options](./self-hosted-experimental.md

## 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.

Add two properties to `config.js`: `allowPostUpgradeCommandTemplating` and `allowedPostUpgradeCommands`:

```javascript
module.exports = {
allowPostUpgradeCommandTemplating: true,
allowedPostUpgradeCommands: ['^npm ci --ignore-scripts$', '^npx ng update'],
};
```
Expand Down Expand Up @@ -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
```

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

## allowedPostUpgradeCommands
Expand Down
4 changes: 2 additions & 2 deletions lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const options: RenovateOptions[] = [
{
name: 'allowPostUpgradeCommandTemplating',
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',
default: false,
default: true,
globalOnly: true,
},
{
Expand Down

0 comments on commit d11731c

Please sign in to comment.