Skip to content

Commit

Permalink
ci: run post upgrade commands only when needed
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
  • Loading branch information
phisco committed Apr 21, 2024
1 parent 41c7ede commit fa8d2e4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
42 changes: 32 additions & 10 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,38 @@
// Renovate evaluates all packageRules in order, so low priority rules should
// be at the beginning, high priority at the end
"packageRules": [
{
"description": "Generate code after upgrading go dependencies",
"matchDatasources": ["go"],
postUpgradeTasks: {
// Post-upgrade tasks that are executed before a commit is made by Renovate.
"commands": [
"git submodule update --init",
"install-tool golang $(grep -oP \"^toolchain go\\K.+\" go.mod)",
"make generate",
],
fileFilters: [
"**/*"
],
executionMode: "update",
},
},
{
"description": "Lint code after upgrading golangci-lint",
"matchDepNames": ["golangci/golangci-lint"],
postUpgradeTasks: {
// Post-upgrade tasks that are executed before a commit is made by Renovate.
"commands": [
"git submodule update --init",
"install-tool golang $(grep -oP \"^toolchain go\\K.+\" go.mod)",
"make lint",
],
fileFilters: [
"**/*"
],
executionMode: "update",
},
},
{
"matchManagers": ["crossplane"],
"matchFileNames": ["test/e2e/**"],
Expand Down Expand Up @@ -131,14 +163,4 @@
"enabled": false
}
],
postUpgradeTasks: {
// Post-upgrade tasks that are executed before a commit is made by Renovate.
"commands": [
"git submodule update --init",
"install-tool golang $(grep -oP \"^toolchain go\\K.+\" go.mod)",
"make generate"
],
fileFilters: ["**/*"],
executionMode: "update",
}
}
2 changes: 1 addition & 1 deletion .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# Use GitHub API to create commits
RENOVATE_PLATFORM_COMMIT: "true"
LOG_LEVEL: ${{ github.event.inputs.logLevel || env.LOG_LEVEL }}
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^git submodule update --init$", "^make generate$", "^install-tool golang \\$\\(grep -oP \"\\^toolchain go\\\\K\\.\\+\" go\\.mod\\)$"]'
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^git submodule update --init$", "^make generate$", "^install-tool golang \\$\\(grep -oP \"\\^toolchain go\\\\K\\.\\+\" go\\.mod\\)$", "^make lint$"]'
with:
configurationFile: .github/renovate.json5
token: '${{ steps.get-github-app-token.outputs.token }}'

0 comments on commit fa8d2e4

Please sign in to comment.