mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-02-05 13:25:19 +02:00
feat(renovate): automerge PRs for patch updates (#5252)
* Enable automerge for non-major dep module updates * Trigger integration tests on each renovatebot PR update * Remove trailing space * Set label for renovate PRs * Enable rollback PRs * Fix config: move rollbackPrs to proper place * Fix workflow (trigger on push) * Remove trailing space * Automerge only patch version updates (except versions 0.x) * Add packageRule for rollbackPrs * Update renovate.json --------- Co-authored-by: Ivan Nikiforov <ivan.nikiforov@sap.com> Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
parent
c5ab6a781e
commit
f7206987fa
18
.github/renovate.json
vendored
18
.github/renovate.json
vendored
@ -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"
|
||||
|
39
.github/workflows/renovate-integration-tests.yml
vendored
Normal file
39
.github/workflows/renovate-integration-tests.yml
vendored
Normal file
@ -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'
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user