Skip to content

Commit 778dd2d

Browse files
Merge pull request #1 from BTreeMap/copilot/fix-github-actions-dependencies
Localize CI workflows, enforce lowercase GHCR tagging, and simplify fork maintenance
2 parents e5e683b + 9dfbf9c commit 778dd2d

9 files changed

Lines changed: 456 additions & 402 deletions

File tree

.github/renovate.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,27 @@
55
"labels": ["dependencies", "no-stale"],
66
"commitMessagePrefix": "⬆️",
77
"commitMessageTopic": "{{depName}}",
8-
"extends": ["customManagers:dockerfileVersions"],
8+
"enabledManagers": ["customManagers", "dockerfile", "github-actions"],
9+
"customManagers": [
10+
{
11+
"customType": "regex",
12+
"fileMatch": ["^cloudflared/Dockerfile$"],
13+
"matchStrings": ["ARG YQ_VERSION=\"(?<currentValue>[^\"]+)\""],
14+
"datasourceTemplate": "repology",
15+
"depNameTemplate": "yq-go",
16+
"packageNameTemplate": "alpine_3_22/yq-go",
17+
"versioningTemplate": "loose"
18+
},
19+
{
20+
"customType": "regex",
21+
"fileMatch": ["^cloudflared/Dockerfile$"],
22+
"matchStrings": ["ARG CLOUDFLARED_VERSION=\"(?<currentValue>[^\"]+)\""],
23+
"datasourceTemplate": "github-releases",
24+
"depNameTemplate": "cloudflared",
25+
"packageNameTemplate": "cloudflare/cloudflared",
26+
"versioningTemplate": "loose"
27+
}
28+
],
929
"packageRules": [
1030
{
1131
"groupName": "App (Add-on) base image",

.github/workflows/ci.yaml

Lines changed: 11 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -15,171 +15,15 @@ on:
1515
- synchronize
1616
workflow_dispatch:
1717

18-
jobs:
19-
information:
20-
name: Gather app (add-on) information
21-
runs-on: ubuntu-latest
22-
outputs:
23-
architectures: ${{ steps.information.outputs.architectures }}
24-
build: ${{ steps.information.outputs.build }}
25-
description: ${{ steps.information.outputs.description }}
26-
name: ${{ steps.information.outputs.name }}
27-
slug: ${{ steps.override.outputs.slug }}
28-
target: ${{ steps.information.outputs.target }}
29-
steps:
30-
- name: ⤵️ Check out code from GitHub
31-
uses: actions/checkout@v6
32-
- name: 🚀 Run app (add-on) information action
33-
id: information
34-
uses: homeassistant-apps/action-app-information@v2
35-
- name: 🚀 Process possible slug override
36-
id: override
37-
run: |
38-
slug="${{ steps.information.outputs.slug }}"
39-
if [[ ! -z "${{ inputs.slug }}" ]]; then
40-
slug="${{ inputs.slug }}"
41-
fi
42-
echo "slug=$slug" >> $GITHUB_OUTPUT
43-
44-
lint-addon:
45-
name: Lint App (Add-on)
46-
needs:
47-
- information
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: ⤵️ Check out code from GitHub
51-
uses: actions/checkout@v6
52-
- name: 🚀 Run Add-on Lint
53-
uses: homeassistant-apps/action-app-linter@v3.1
54-
with:
55-
community: true
56-
path: "./${{ needs.information.outputs.target }}"
57-
58-
lint-hadolint:
59-
name: Hadolint
60-
needs:
61-
- information
62-
runs-on: ubuntu-latest
63-
steps:
64-
- name: ⤵️ Check out code from GitHub
65-
uses: actions/checkout@v6
66-
- name: 🚀 Run Hadolint
67-
uses: brpaz/hadolint-action@v1.5.0
68-
with:
69-
dockerfile: "./${{ needs.information.outputs.target }}/Dockerfile"
70-
71-
lint-json:
72-
name: JSON Lint
73-
runs-on: ubuntu-latest
74-
steps:
75-
- name: ⤵️ Check out code from GitHub
76-
uses: actions/checkout@v6
77-
- name: 🚀 Run JQ
78-
run: |
79-
shopt -s globstar
80-
cat **/*.json | jq '.'
81-
82-
lint-markdown:
83-
name: MarkdownLint
84-
runs-on: ubuntu-latest
85-
steps:
86-
- name: ⤵️ Check out code from GitHub
87-
uses: actions/checkout@v6
88-
- name: 🚀 Run mdl
89-
uses: actionshub/markdownlint@v3.1.4
18+
permissions:
19+
contents: write
20+
pull-requests: read
9021

91-
lint-shellcheck:
92-
name: Shellcheck
93-
runs-on: ubuntu-latest
94-
steps:
95-
- name: ⤵️ Check out code from GitHub
96-
uses: actions/checkout@v6
97-
- name: 🚀 Run Shellcheck
98-
uses: ludeeus/action-shellcheck@2.0.0
99-
env:
100-
SHELLCHECK_OPTS: -s bash
101-
102-
lint-yamllint:
103-
name: YAMLLint
104-
runs-on: ubuntu-latest
105-
steps:
106-
- name: ⤵️ Check out code from GitHub
107-
uses: actions/checkout@v6
108-
- name: 🚀 Run YAMLLint
109-
uses: frenck/action-yamllint@v1.5
110-
111-
lint-prettier:
112-
name: Prettier
113-
runs-on: ubuntu-latest
114-
steps:
115-
- name: ⤵️ Check out code from GitHub
116-
uses: actions/checkout@v6
117-
- name: 🚀 Run Prettier
118-
uses: creyD/prettier_action@v4.6
119-
with:
120-
prettier_options: --write **/*.{json,js,md,yaml}
121-
122-
build:
123-
name: Build ${{ matrix.architecture }}
124-
needs:
125-
- information
126-
- lint-addon
127-
- lint-hadolint
128-
- lint-json
129-
- lint-markdown
130-
- lint-prettier
131-
- lint-shellcheck
132-
- lint-yamllint
133-
runs-on: ubuntu-latest
134-
strategy:
135-
matrix:
136-
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
137-
steps:
138-
- name: ⤵️ Check out code from GitHub
139-
uses: actions/checkout@v6
140-
- name: 🏗 Set up QEMU
141-
uses: docker/setup-qemu-action@v3.7.0
142-
- name: 🏗 Set up Docker Buildx
143-
uses: docker/setup-buildx-action@v3.12.0
144-
- name: ℹ️ Compose build flags
145-
id: flags
146-
run: |
147-
echo "date=$(date +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
148-
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
149-
echo "platform=linux/amd64" >> $GITHUB_OUTPUT
150-
elif [[ "${{ matrix.architecture }}" = "aarch64" ]]; then
151-
echo "platform=linux/arm64/v8" >> $GITHUB_OUTPUT
152-
else
153-
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
154-
exit 1
155-
fi
156-
- name: 🚀 Build
157-
uses: docker/build-push-action@v6.18.0
158-
with:
159-
push: false
160-
context: ${{ needs.information.outputs.target }}
161-
file: ${{ needs.information.outputs.target }}/Dockerfile
162-
cache-from: type=gha,scope=${{ needs.information.outputs.slug }}-${{ matrix.architecture }}
163-
cache-to: type=gha,mode=max,scope=${{ needs.information.outputs.slug }}-${{ matrix.architecture }}
164-
platforms: ${{ steps.flags.outputs.platform }}
165-
build-args: |
166-
BUILD_ARCH=${{ matrix.architecture }}
167-
BUILD_DATE=${{ steps.flags.outputs.date }}
168-
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
169-
BUILD_FROM=${{ steps.flags.outputs.from }}
170-
BUILD_NAME=${{ needs.information.outputs.name }}
171-
BUILD_REF=${{ github.sha }}
172-
BUILD_REPOSITORY=${{ github.repository }}
173-
BUILD_VERSION=edge
174-
175-
update_release_draft:
176-
name: Draft release
177-
needs:
178-
- build
179-
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
180-
runs-on: ubuntu-latest
181-
steps:
182-
- name: 🚀 Run Release Drafter
183-
uses: homeassistant-apps/action-release-drafter@v6.1.1
184-
env:
185-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
jobs:
23+
ci:
24+
uses: ./.github/workflows/upstream/ci.yaml
25+
secrets: inherit
26+
with:
27+
default_branch: ${{ github.event.repository.default_branch }}
28+
event_name: ${{ github.event_name }}
29+
ref_name: ${{ github.ref_name }}

0 commit comments

Comments
 (0)