Skip to content

Commit 19bdd60

Browse files
committed
Raj Singh
Customer Reliability Engineer [email protected]
1 parent f9588cc commit 19bdd60

File tree

15 files changed

+563
-121
lines changed

15 files changed

+563
-121
lines changed

.github/auto_merge.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import os
2+
from github import Github
3+
4+
# Retrieve the GitHub token from the environment variable
5+
GITHUB_TOKEN = os.getenv("GITHUB_PAT")
6+
REPO_NAME = "gavinmcfall/home-ops"
7+
8+
if not GITHUB_TOKEN:
9+
raise ValueError("Please set the GITHUB_PAT environment variable.")
10+
11+
def auto_merge_minor_patch_prs():
12+
g = Github(GITHUB_TOKEN)
13+
repo = g.get_repo(REPO_NAME)
14+
15+
pr_count = 0
16+
open_prs = repo.get_pulls(state="open", sort="created", direction="desc")
17+
18+
for pr in open_prs:
19+
print(f"Checking PR #{pr.number}: {pr.title}")
20+
try:
21+
comments = pr.get_issue_comments()
22+
for comment in comments:
23+
print(f" Comment: {comment.body}")
24+
if "minor" in comment.body.lower() or "patch" in comment.body.lower():
25+
print(f"Merging PR #{pr.number}: {pr.title}")
26+
pr.merge()
27+
pr_count += 1
28+
break
29+
except Exception as e:
30+
print(f"Error processing PR #{pr.number}: {e}")
31+
32+
print(f"Processed {pr_count} PR(s).")
33+
34+
if __name__ == "__main__":
35+
auto_merge_minor_patch_prs()

.github/labeler.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
area/bootstrap:
3+
- changed-files:
4+
- any-glob-to-any-file: bootstrap/**/*
5+
area/github:
6+
- changed-files:
7+
- any-glob-to-any-file: .github/**/*
8+
area/kubernetes:
9+
- changed-files:
10+
- any-glob-to-any-file: kubernetes/**/*
11+
area/taskfile:
12+
- changed-files:
13+
- any-glob-to-any-file: .taskfiles/**/*
14+
- any-glob-to-any-file: Taskfile*

.github/labels.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
# Area
3+
- { name: "area/bootstrap", color: "0e8a16" }
4+
- { name: "area/github", color: "0e8a16" }
5+
- { name: "area/kubernetes", color: "0e8a16" }
6+
- { name: "area/taskfile", color: "0e8a16" }
7+
# Distro
8+
- { name: "distro/talos", color: "ffc300" }
9+
# Renovate
10+
- { name: "renovate/container", color: "027fa0" }
11+
- { name: "renovate/github-action", color: "027fa0" }
12+
- { name: "renovate/github-release", color: "027fa0" }
13+
- { name: "renovate/helm", color: "027fa0" }
14+
# Semantic Type
15+
- { name: "type/patch", color: "ffec19" }
16+
- { name: "type/minor", color: "ff9800" }
17+
- { name: "type/major", color: "f6412d" }
18+
- { name: "type/break", color: "f6412d" }
19+
# Uncategorized
20+
- { name: "hold/upstream", color: "ee0701" }

.github/release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- renovate

.github/rennovate.json

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/renovate.json5

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
"docker:enableMajor",
6+
":disableRateLimiting",
7+
":dependencyDashboard",
8+
":semanticCommits",
9+
":automergeBranch"
10+
],
11+
"dependencyDashboard": true,
12+
"dependencyDashboardTitle": "Renovate Dashboard 🤖",
13+
"suppressNotifications": ["prEditedNotification", "prIgnoreNotification"],
14+
"rebaseWhen": "conflicted",
15+
"schedule": ["every weekend"],
16+
"ignorePaths": ["**/*.sops.*"],
17+
"flux": {
18+
"fileMatch": ["(^|/)kubernetes/.+\\.ya?ml(?:\\.j2)?$"]
19+
},
20+
"helm-values": {
21+
"fileMatch": ["(^|/)kubernetes/.+\\.ya?ml(?:\\.j2)?$"]
22+
},
23+
"helmfile": {
24+
"fileMatch": ["(^|/)helmfile\\.ya?ml(?:\\.j2)?$"]
25+
},
26+
"kubernetes": {
27+
"fileMatch": ["(^|/)kubernetes/.+\\.ya?ml(?:\\.j2)?$"]
28+
},
29+
"kustomize": {
30+
"fileMatch": ["(^|/)kustomization\\.ya?ml(?:\\.j2)?$"]
31+
},
32+
"pip_requirements": {
33+
"fileMatch": ["(^|/)[\\w-]*requirements(-\\w+)?\\.(txt|pip)(?:\\.j2)?$"]
34+
},
35+
"commitMessageTopic": "{{depName}}",
36+
"commitMessageExtra": "to {{newVersion}}",
37+
"commitMessageSuffix": "",
38+
"packageRules": [
39+
{
40+
"description": ["Auto merge Github Actions"],
41+
"matchManagers": ["github-actions"],
42+
"automerge": true,
43+
"automergeType": "branch",
44+
"ignoreTests": true,
45+
"matchUpdateTypes": ["minor", "patch"]
46+
},
47+
{
48+
"matchUpdateTypes": ["minor", "patch"],
49+
"matchCurrentVersion": "!/^0/",
50+
"automerge": true
51+
},
52+
{
53+
"matchUpdateTypes": ["digest"],
54+
"automerge": true
55+
},
56+
{
57+
"description": ["Flux Group"],
58+
"groupName": "Flux",
59+
"matchPackagePatterns": ["fluxcd"],
60+
"matchDatasources": ["docker", "github-tags"],
61+
"versioning": "semver",
62+
"group": {
63+
"commitMessageTopic": "{{{groupName}}} group"
64+
},
65+
"separateMinorPatch": true
66+
},
67+
{
68+
"description": ["Talos Group"],
69+
"groupName": "Talos",
70+
"matchPackagePatterns": [
71+
"siderolabs/talosctl",
72+
"siderolabs/installer"
73+
],
74+
"matchDatasources": ["docker"],
75+
"group": {
76+
"commitMessageTopic": "{{{groupName}}} group"
77+
},
78+
"separateMinorPatch": true
79+
},
80+
{
81+
"matchDatasources": ["helm"],
82+
"commitMessageTopic": "chart {{depName}}"
83+
},
84+
{
85+
"matchDatasources": ["docker"],
86+
"commitMessageTopic": "image {{depName}}"
87+
},
88+
{
89+
"matchDatasources": ["docker"],
90+
"matchUpdateTypes": ["major"],
91+
"commitMessagePrefix": "feat(container)!: "
92+
},
93+
{
94+
"matchDatasources": ["docker"],
95+
"matchUpdateTypes": ["minor"],
96+
"semanticCommitType": "feat",
97+
"semanticCommitScope": "container"
98+
},
99+
{
100+
"matchDatasources": ["docker"],
101+
"matchUpdateTypes": ["patch"],
102+
"semanticCommitType": "fix",
103+
"semanticCommitScope": "container"
104+
},
105+
{
106+
"matchDatasources": ["docker"],
107+
"matchUpdateTypes": ["digest"],
108+
"semanticCommitType": "chore",
109+
"semanticCommitScope": "container"
110+
}
111+
]
112+
}

.github/tests/config-talos.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
skip_tests: true
3+
4+
boostrap_talos:
5+
schematic_id: "376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba"
6+
bootstrap_node_network: 10.10.10.0/24
7+
bootstrap_node_default_gateway: 10.10.10.1
8+
bootstrap_node_inventory:
9+
- name: k8s-controller-0
10+
address: 10.10.10.100
11+
controller: true
12+
disk: fake
13+
mac_addr: fake
14+
- name: k8s-worker-0
15+
address: 10.10.10.101
16+
controller: false
17+
disk: fake
18+
mac_addr: fake
19+
bootstrap_dns_servers: ["1.1.1.1", "1.0.0.1"]
20+
bootstrap_ntp_servers: ["time.cloudflare.com"]
21+
bootstrap_pod_network: 10.69.0.0/16
22+
bootstrap_service_network: 10.96.0.0/16
23+
bootstrap_controller_vip: 10.10.10.254
24+
bootstrap_tls_sans: ["fake"]
25+
bootstrap_sops_age_pubkey: $BOOTSTRAP_AGE_PUBLIC_KEY
26+
bootstrap_bgp:
27+
enabled: false
28+
bootstrap_github_address: https://github.com/onedr0p/cluster-template
29+
bootstrap_github_branch: main
30+
bootstrap_github_webhook_token: fake
31+
bootstrap_cloudflare:
32+
enabled: true
33+
domain: fake
34+
token: take
35+
acme:
36+
37+
production: false
38+
tunnel:
39+
account_id: fake
40+
id: fake
41+
secret: fake
42+
ingress_vip: 10.10.10.252
43+
ingress_vip: 10.10.10.251
44+
gateway_vip: 10.10.10.253
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3+
name: "devcontainer"
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches: ["main"]
9+
paths: [".devcontainer/ci/**"]
10+
pull_request:
11+
branches: ["main"]
12+
paths: [".devcontainer/ci/**"]
13+
schedule:
14+
- cron: "0 0 * * *"
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
devcontainer:
22+
if: ${{ github.repository == 'onedr0p/cluster-template' }}
23+
name: publish
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
with:
38+
platforms: linux/amd64 #,linux/arm64
39+
40+
- if: ${{ github.event_name != 'pull_request' }}
41+
name: Login to GitHub Container Registry
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Build and push
49+
uses: devcontainers/[email protected]
50+
env:
51+
BUILDX_NO_DEFAULT_ATTESTATIONS: true
52+
with:
53+
imageName: ghcr.io/${{ github.repository }}/devcontainer
54+
# cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
55+
imageTag: base,latest
56+
platform: linux/amd64 #,linux/arm64
57+
configFile: .devcontainer/ci/devcontainer.json
58+
push: ${{ github.event_name == 'pull_request' && 'never' || 'always' }}

0 commit comments

Comments
 (0)