Skip to content

Commit 7a27221

Browse files
committed
chore: Implement Renovate (#502)
1 parent b60d9c0 commit 7a27221

File tree

5 files changed

+170
-5
lines changed

5 files changed

+170
-5
lines changed

.github/renovate.json

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended"
5+
],
6+
"commitMessageLowerCase": "never",
7+
"labels": [
8+
"dependencies"
9+
],
10+
"prConcurrentLimit": 0,
11+
"prHourlyLimit": 0,
12+
"schedule": [
13+
"* 0-7 * * 1"
14+
],
15+
"separateMultipleMajor": true,
16+
"packageRules": [
17+
{
18+
"groupName": "Ansible collections",
19+
"matchManagers": [
20+
"ansible-galaxy",
21+
"custom.regex"
22+
]
23+
}
24+
],
25+
"ansible-galaxy": {
26+
"fileMatch": [
27+
"(^|/)[\\w-]*requirements([_.]\\w+)?\\.ya?ml$"
28+
],
29+
"packageRules": [
30+
{
31+
"automerge": true,
32+
"matchCurrentVersion": "!/^0/",
33+
"matchUpdateTypes": [
34+
"minor",
35+
"patch"
36+
]
37+
}
38+
]
39+
},
40+
"customManagers": [
41+
{
42+
"customType": "regex",
43+
"datasourceTemplate": "galaxy-collection",
44+
"fileMatch": [
45+
"README.md"
46+
],
47+
"matchStrings": [
48+
"- name: (?<depName>\\w+\\.\\w+)(?:\\s+#.*)?\\s+version: (?<currentValue>\\d+\\.\\d+\\.\\d+)"
49+
],
50+
"versioningTemplate": "semver"
51+
}
52+
],
53+
"dockerfile": {
54+
"ignorePaths": [
55+
"molecule/**/Dockerfile.j2"
56+
]
57+
},
58+
"github-actions": {
59+
"addLabels": [
60+
"skip changelog"
61+
],
62+
"packageRules": [
63+
{
64+
"groupName": "GitHub Actions",
65+
"matchPackageNames": [
66+
"actions/**",
67+
"github/**"
68+
]
69+
},
70+
{
71+
"groupName": "Docker Actions",
72+
"matchPackageNames": [
73+
"docker/**"
74+
]
75+
},
76+
{
77+
"enabled": false,
78+
"matchUpdateTypes": [
79+
"digest"
80+
]
81+
},
82+
{
83+
"automerge": true,
84+
"matchUpdateTypes": [
85+
"minor",
86+
"patch"
87+
],
88+
"matchCurrentVersion": "!/^0/"
89+
}
90+
]
91+
},
92+
"pip_requirements": {
93+
"fileMatch": [
94+
"(^|/)[\\w-]*requirements([_.]\\w+)?\\.(txt|pip)$"
95+
],
96+
"packageRules": [
97+
{
98+
"groupName": "Python dependencies",
99+
"matchPackageNames": [
100+
"*"
101+
]
102+
},
103+
{
104+
"groupName": "Ansible core",
105+
"matchPackageNames": [
106+
"ansible-core"
107+
],
108+
"separateMinorPatch": true
109+
},
110+
{
111+
"automerge": true,
112+
"matchUpdateTypes": [
113+
"patch"
114+
],
115+
"matchCurrentVersion": "!/^0/"
116+
}
117+
]
118+
}
119+
}

.github/workflows/milestone-pr.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Milestone & Project PR Automation
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
7+
permissions: read-all
8+
jobs:
9+
milestone:
10+
name: Add milestone to GitHub PR
11+
if: github.actor == 'renovate[bot]'
12+
runs-on: ubuntu-24.04
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
steps:
17+
- name: Find current milestone and add it to GitHub PR
18+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
19+
with:
20+
script: |
21+
const { data: [milestone] } = await github.rest.issues.listMilestones({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
});
25+
26+
await github.rest.issues.update({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
issue_number: context.issue.number,
30+
milestone: milestone.number,
31+
});
32+
33+
project:
34+
name: Add project to GitHub PR
35+
if: github.actor == 'renovate[bot]'
36+
runs-on: ubuntu-24.04
37+
steps:
38+
- name: Add Project
39+
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v.1.0.2
40+
with:
41+
project-url: https://github.com/orgs/nginxinc/projects/17/views/1
42+
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }}

.github/workflows/requirements/requirements_collections.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ collections:
44
version: 1.5.4
55
- name: community.general
66
version: 9.2.0
7-
- name: community.crypto # Only required if you plan to to test the NGINX Plus Molecule scenario
7+
- name: community.crypto
88
version: 2.21.1
9-
- name: community.docker # Only required if you plan to use Molecule
9+
- name: community.docker
1010
version: 3.11.0

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ CI/CD:
3434
- Switch GitHub Actions from using tags to release hashes.
3535
- Remove platform metadata from the Ansible Galaxy role metadata since platforms are no longer supported in Ansible Galaxy NG.
3636
- Implement OSSF Scorecard.
37+
- Implement Renovate.
38+
- Automatically add milestone and project data to Renovate Bot PRs.
3739

3840
MAINTENANCE:
3941

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ This will also ensure you are deploying/running this role with a fully tested ve
4242
- name: ansible.posix
4343
version: 1.5.4
4444
- name: community.general
45-
version: 9.0.1
46-
- name: community.docker # Only required if you plan to use Molecule (see below)
47-
version: 3.10.3
45+
version: 9.2.0
46+
- name: community.crypto # Only required if you plan to to test the NGINX Plus Molecule scenario
47+
version: 2.21.1
48+
- name: community.docker # Only required if you plan to use Molecule
49+
version: 3.11.0
4850
```
4951
5052
- Instructions on how to install Ansible core can be found in the [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#upgrading-ansible-from-version-2-9-and-older-to-version-2-10-or-later) docs.

0 commit comments

Comments
 (0)