diff --git a/.github/renovate-entrypoint.sh b/.github/renovate-entrypoint.sh new file mode 100644 index 000000000..f6087a619 --- /dev/null +++ b/.github/renovate-entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +curl -fsSLo /usr/local/bin/earthly https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly +chmod +x /usr/local/bin/earthly +/usr/local/bin/earthly bootstrap + +runuser -u ubuntu renovate \ No newline at end of file diff --git a/.github/renovate.json5 b/.github/renovate.json5 index cad1b6966..1f5d13bef 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -99,10 +99,12 @@ // be at the beginning, high priority at the end "packageRules": [ { - "description": "Generate code after upgrading go dependencies", + "description": "Generate code after upgrading go dependencies (master)", "matchDatasources": [ "go" ], + // Currently we only have an Earthfile on master. + matchBaseBranches: ["master"], postUpgradeTasks: { // Post-upgrade tasks that are executed before a commit is made by Renovate. "commands": [ @@ -115,10 +117,30 @@ }, }, { - "description": "Lint code after upgrading golangci-lint", + "description": "Generate code after upgrading go dependencies (release branch)", + "matchDatasources": [ + "go" + ], + // Currently we only have an Earthfile on master. + matchBaseBranches: ["release-.+"], + postUpgradeTasks: { + // Post-upgrade tasks that are executed before a commit is made by Renovate. + "commands": [ + "make go.generate", + ], + fileFilters: [ + "**/*" + ], + executionMode: "update", + }, + }, + { + "description": "Lint code after upgrading golangci-lint (master)", "matchDepNames": [ "golangci/golangci-lint" ], + // Currently we only have an Earthfile on master. + matchBaseBranches: ["master"], postUpgradeTasks: { // Post-upgrade tasks that are executed before a commit is made by Renovate. "commands": [ @@ -131,13 +153,22 @@ }, }, { - "matchManagers": [ - "crossplane" - ], - "matchFileNames": [ - "test/e2e/**" + "description": "Lint code after upgrading golangci-lint (release branch)", + "matchDepNames": [ + "golangci/golangci-lint" ], - "groupName": "e2e-manifests", + // Currently we only have an Earthfile on master. + matchBaseBranches: ["release-.+"], + postUpgradeTasks: { + // Post-upgrade tasks that are executed before a commit is made by Renovate. + "commands": [ + "make go.lint", + ], + fileFilters: [ + "**/*" + ], + executionMode: "update", + }, }, { "description": "Ignore non-security related updates to release branches", @@ -220,4 +251,4 @@ "groupName": "golang version", } ], -} +} \ No newline at end of file diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index b1390ff79..799766699 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -27,12 +27,6 @@ jobs: - name: Checkout uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - name: Setup Earthly - uses: earthly/actions-setup@v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - version: ${{ env.EARTHLY_VERSION }} - # Don't waste time starting Renovate if JSON is invalid - name: Validate Renovate JSON run: npx --yes --package renovate -- renovate-config-validator @@ -55,3 +49,6 @@ jobs: with: configurationFile: .github/renovate.json5 token: '${{ steps.get-github-app-token.outputs.token }}' + mount-docker-socket: true + docker-user: root + docker-cmd-file: .github/renovate-entrypoint.sh