Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
133d736
Fix deploy workflow permissions
mistral-vibe May 25, 2026
37a9372
Fix CI workflow permissions
mistral-vibe May 25, 2026
662a199
Add workflow_dispatch to Deploy workflow and fix Hadolint issues
mistral-vibe May 25, 2026
1f843f6
Fix Lint App errors
mistral-vibe May 25, 2026
4274b34
Update to Home Assistant Apps standard and fix all issues
mdeweerd May 25, 2026
64d7210
:wrench: Update GitHub Actions versions
mdeweerd May 25, 2026
59515c5
:memo: Add repository configuration for MetersToHA
mdeweerd May 25, 2026
a0a869d
:wrench: Remove security-events write permission from CI workflow
mdeweerd May 25, 2026
373ad7b
fix: Align deploy flow with Home Assistant apps standard
mistral-vibe May 25, 2026
a7ce916
fix: Use tag versions for GitHub Actions to resolve action errors
mistral-vibe May 25, 2026
b811ce0
fix: Remove unused update_config_version.py script to fix pre-commit …
mistral-vibe May 25, 2026
c3fce67
fix: Add security-events permission for zizmor action
mistral-vibe May 25, 2026
cfc8549
fix: Change security-events permission to write for zizmor action
mistral-vibe May 25, 2026
8481ab8
:wrench: Update upload-release-action version in release workflow
mdeweerd May 25, 2026
a89e27e
Merge branch 'fix/deploy' of github.com:mdeweerd/MetersToHA into fix/…
mdeweerd May 25, 2026
5304212
:wrench: Update GitHub Actions workflows
mdeweerd May 25, 2026
1692880
:rocket: Update publish-multi-arch-manifest action version
mdeweerd May 25, 2026
fb46ddc
:wrench: Update GitHub Actions permissions
mdeweerd May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 135 additions & 2 deletions .github/workflows/addon-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,139 @@ on:
- synchronize
workflow_dispatch:

permissions:
actions: read
contents: read
packages: read
security-events: read

jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/addon-ci.yaml@main
information:
name: Gather app information
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.information.outputs.architectures }}
build: ${{ steps.information.outputs.build }}
description: ${{ steps.information.outputs.description }}
name: ${{ steps.information.outputs.name }}
slug: ${{ steps.information.outputs.slug }}
target: ${{ steps.information.outputs.target }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run app information action
id: information
uses: frenck/action-addon-information@ce1377e9851cf569c29329e65fb2c57e67ca0f69 # v1.4.2

lint-app:
name: Lint App
needs:
- information
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run App Lint
uses: frenck/action-addon-linter@f995494fd84fae6310d23617e66d0e37de4f14eb # v2.21.0
with:
path: "./${{ needs.information.outputs.target }}"

lint-hadolint:
name: Hadolint
needs:
- information
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run Hadolint
uses: brpaz/hadolint-action@v1.5.0
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
with:
dockerfile: "./${{ needs.information.outputs.target }}/Dockerfile"

lint-json:
name: JSON Lint
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run JQ
run: |
shopt -s globstar nullglob
for file in **/*.json; do
if ! jq '.' "$file" > /dev/null 2>&1; then
echo "::error file=${file}::Invalid JSON in ${file}"
jq '.' "$file"
exit 1
fi
done

lint-shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run Shellcheck
uses: ludeeus/action-shellcheck@2.0.0
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
env:
SHELLCHECK_OPTS: -s bash

lint-yamllint:
name: YAMLLint
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run YAMLLint
uses: frenck/action-yamllint@34b4bbcaeabedcfefad6adea8c5bbc42af0e2d47 # v1.5

lint-prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run Prettier
uses: creyD/prettier_action@v4.6
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
with:
prettier_options: --check **/*.{json,js,md,yaml}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lint-zizmor:
name: zizmor
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run zizmor
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6

dependency-review:
name: Dependency review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Dependency review
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
114 changes: 0 additions & 114 deletions .github/workflows/build.yaml

This file was deleted.

116 changes: 106 additions & 10 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,111 @@
release:
types:
- published
workflow_run:
workflows: ["CI"]
branches: [meters-to-ha]
types:
- completed
workflow_dispatch:

permissions:
contents: read
id-token: write
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
packages: write
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed

jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/addon-deploy.yaml@main
#secrets: inherit
secrets:
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.info.outputs.architectures }}
build_matrix: ${{ steps.matrix.outputs.matrix }}
image_name: ${{ steps.normalize.outputs.image_name }}
name: ${{ steps.normalize.outputs.name }}
description: ${{ steps.normalize.outputs.description }}
url: ${{ steps.normalize.outputs.url }}
registry_prefix: ${{ steps.normalize.outputs.registry_prefix }}
version: ${{ steps.normalize.outputs.version }}
steps:
- name: Check out the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2

Check warning on line 31 in .github/workflows/deploy.yaml

View workflow job for this annotation

GitHub Actions / YAMLLint

missing starting space in comment

Check warning on line 31 in .github/workflows/deploy.yaml

View workflow job for this annotation

GitHub Actions / YAMLLint

missing starting space in comment
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed

- name: Get app information
id: info
uses: home-assistant/actions/helpers/info@master
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
with:
path: "./addon_meterstoha"

- name: Normalize app information
id: normalize
run: |
image=${{ steps.info.outputs.image }}
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
echo "image_name=${image##*/}" >> "$GITHUB_OUTPUT"
echo "registry_prefix=${image%/*}" >> "$GITHUB_OUTPUT"
version=${{ steps.info.outputs.version }}
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
echo "version=${version}" >> "$GITHUB_OUTPUT"
name=${{ steps.info.outputs.name }}
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
echo "name=${name}" >> "$GITHUB_OUTPUT"
description=${{ steps.info.outputs.description }}
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
echo "description=${description}" >> "$GITHUB_OUTPUT"
url=${{ steps.info.outputs.url }}
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
if [[ -n "$url" && "$url" != "null" ]]; then
echo "url=${url}" >> "$GITHUB_OUTPUT"
fi

- name: Prepare build matrix
id: matrix
uses: home-assistant/builder/actions/prepare-multi-arch-matrix@2026.03.2
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
with:
architectures: ${{ steps.info.outputs.architectures }}
image-name: ${{ steps.normalize.outputs.image_name }}
registry-prefix: ${{ steps.normalize.outputs.registry_prefix }}

build:
name: Build ${{ matrix.arch }} image
needs: prepare
runs-on: ${{ matrix.os }}
permissions:
contents: read
id-token: write
packages: write
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.build_matrix) }}
steps:
- name: Check out the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2

Check warning on line 77 in .github/workflows/deploy.yaml

View workflow job for this annotation

GitHub Actions / YAMLLint

missing starting space in comment

Check warning on line 77 in .github/workflows/deploy.yaml

View workflow job for this annotation

GitHub Actions / YAMLLint

missing starting space in comment
with:
persist-credentials: false

- name: Build image
uses: home-assistant/builder/actions/build-image@2026.03.2
Comment thread
mdeweerd marked this conversation as resolved.
Dismissed
with:
arch: ${{ matrix.arch }}
container-registry-password: ${{ secrets.GITHUB_TOKEN }}
context: "./addon_meterstoha"
image: ${{ matrix.image }}
image-tags: |
${{ needs.prepare.outputs.version }}
latest
labels: |
io.hass.type=app
io.hass.name=${{ needs.prepare.outputs.name }}
io.hass.description=${{ needs.prepare.outputs.description }}
${{ needs.prepare.outputs.url && format('io.hass.url={0}', needs.prepare.outputs.url) || '' }}
push: true
version: ${{ needs.prepare.outputs.version }}

manifest:
name: Publish multi-arch manifest
needs: [prepare, build]
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
steps:
- name: Publish multi-arch manifest
uses: home-assistant/builder/actions/publish-multi-arch-manifest@8b139affa26d40fa3cc0d0cb77a8aefaf417a460
with:
architectures: ${{ needs.prepare.outputs.architectures }}
container-registry-password: ${{ secrets.GITHUB_TOKEN }}
image-name: ${{ needs.prepare.outputs.image_name }}
image-tags: |
${{ needs.prepare.outputs.version }}
latest
registry-prefix: ${{ needs.prepare.outputs.registry_prefix }}
Loading
Loading