diff --git a/.github/renovate.json b/.github/renovate.json index 93f1a3b362..84e73cc963 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -7,6 +7,24 @@ "integration/testdata/**", "test/resources/**" ], + "labels": [ + "dependencies" + ], + "packageRules": [ + { + "description": "Create PRs to roll back Go module if the current version is not found in the registry.", + "matchManagers": ["gomod"], + "rollbackPrs": true + }, + { + "description": "Automerge patch version updates for Go modules (except versions 0.x as they could have breaking changes)", + "matchManagers": ["gomod"], + "matchUpdateTypes": ["patch"], + "matchCurrentVersion": "!/^(v?0)/", + "automerge": true, + "addLabels": ["renovate-automerge"] + } + ], "postUpdateOptions": [ "gomodTidy", "gomodUpdateImportPaths" diff --git a/.github/workflows/renovate-integration-tests.yml b/.github/workflows/renovate-integration-tests.yml new file mode 100644 index 0000000000..fb11677480 --- /dev/null +++ b/.github/workflows/renovate-integration-tests.yml @@ -0,0 +1,39 @@ +name: Renovatebot - Trigger integration tests on PR update + +on: + push: + branches: + - 'renovate/**' + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Post a comment on the PR + uses: actions/github-script@v7 + with: + script: | + const branch = context.ref.replace('refs/heads/', ''); + const repository = context.repo.repo; + const owner = context.repo.owner; + + // Find PRs associated with the branch + const { data: pullRequests } = await github.rest.pulls.list({ + owner: owner, + repo: repository, + head: `${owner}:${branch}`, + state: 'open' + }); + + // Post a comment to each found PR + for (const pr of pullRequests) { + await github.rest.issues.createComment({ + issue_number: pr.number, + owner: owner, + repo: repository, + body: '/it-go' + }); + }