Skip to content

Fix workflow permissions, enable manual triggering, and resolve lint errors - #53

Merged
mdeweerd merged 18 commits into
meters-to-hafrom
fix/deploy
May 26, 2026
Merged

Fix workflow permissions, enable manual triggering, and resolve lint errors#53
mdeweerd merged 18 commits into
meters-to-hafrom
fix/deploy

Conversation

@mdeweerd

@mdeweerd mdeweerd commented May 25, 2026

Copy link
Copy Markdown
Owner

Fix workflow permissions, enable manual triggering, and resolve lint errors.

Changes

Workflow Fixes

  1. deploy.yaml:

    • Add permissions: contents: read, packages: write (required by addon-deploy.yaml)
    • Add workflow_dispatch trigger to allow manual triggering from GitHub UI
  2. addon-ci.yml:

    • Add permissions: actions: read, contents: read, packages: read, security-events: write (required by addon-ci.yaml)

Dockerfile Fixes

  1. Dockerfile:
    • Add hadolint ignore comments for DL3006 (LABEL maintainer position) and DL3003 (multiple RUN commands)
    • Fix formatting in comments

Lint App Fixes

  1. addon_meterstoha/config.yaml:

    • Remove deprecated armv7 architecture from arch list
    • Change version from "v2026.5.3" to dev (required by add-on linter)
  2. addon_meterstoha/build.yaml:

    • Remove deprecated armv7 architecture from build_from configuration
    • Add comment explaining armv7 deprecation

Problems Solved

Workflow Permissions

The hassio-addons reusable workflows require explicit permissions to be granted by the calling workflow. Without these permissions, the workflows fail with a validation error: "The workflow is not valid... The workflow is requesting 'packages: write', but is only allowed 'packages: read'."

Manual Triggering

The Deploy workflow can now be manually triggered from the GitHub Actions UI at:
https://github.com/mdeweerd/meterstoha/actions/workflows/Deploy

Lint Errors

  • Hadolint: Now passes with appropriate ignore comments
  • Lint App: Fixed by removing deprecated armv7 architecture and setting version to 'dev'

Add explicit permissions for packages: write to allow the deploy workflow
to push container images to GitHub Container Registry.

The hassio-addons/workflows addon-deploy.yaml workflow requires packages: write
permission, which must be explicitly granted by the calling workflow.
Add explicit permissions to match the requirements of the hassio-addons/workflows
addon-ci.yaml workflow, which requires actions: read, contents: read, packages: read,
and security-events: write permissions.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@mdeweerd mdeweerd changed the title Fix deploy workflow permissions Fix workflow permissions May 25, 2026
- Add workflow_dispatch trigger to Deploy workflow to allow manual triggering
- Add hadolint ignore comments to Dockerfile for:
  - DL3006: LABEL maintainer position
  - DL3003: Multiple RUN commands
- Fix formatting in Dockerfile comments

This allows users to manually trigger the deploy workflow from the GitHub UI.
@mdeweerd mdeweerd changed the title Fix workflow permissions Fix workflow permissions and enable manual triggering May 25, 2026
- Remove deprecated armv7 architecture from config.yaml and build.yaml
- Change version from 'v2026.5.3' to 'dev' to satisfy add-on linter requirement
- Add comments explaining armv7 deprecation

This fixes the Lint App failures:
- Warning: Architecture 'armv7' is deprecated and no longer supported as of Home Assistant 2025.12
- Error: Add-on version identifier must be 'dev'
@mdeweerd mdeweerd changed the title Fix workflow permissions and enable manual triggering Fix workflow permissions, enable manual triggering, and resolve lint errors May 25, 2026
Comment thread .github/workflows/addon-ci.yml Fixed
Comment thread .github/workflows/addon-ci.yml Fixed
Comment thread .github/workflows/addon-ci.yml Fixed
mdeweerd and others added 4 commits May 26, 2026 00:00
Update the versions of various GitHub Actions used in the CI workflow to their latest stable versions. This ensures we're using the most recent features, security patches, and improvements provided by these actions.
Add repository configuration file with name and URL for the MetersToHA project. This file is required for Home Assistant to recognize and install the app.
The security-events write permission was removed from the CI workflow configuration to reduce unnecessary permissions and enhance security. This change aligns with the principle of least privilege, ensuring that the workflow only has the permissions it needs to function properly.
- Replace hassio-addons deploy workflow with Home Assistant builder actions
- Use home-assistant/builder/actions for multi-arch image building
- Publish images with version tags and latest tag
- Remove redundant build.yaml and docker-image_new.yml workflows
- Keep CI workflow focused on linting and validation
- Add script to update config.yaml version for future use

This aligns the deploy flow with the documentation at:
https://developers.home-assistant.io/docs/apps/publishing

Based on the example repository: home-assistant/apps-example
Comment thread .github/workflows/deploy.yaml Fixed
Comment thread .github/workflows/deploy.yaml Dismissed
Comment thread .github/workflows/deploy.yaml Fixed
Comment thread .github/workflows/deploy.yaml Dismissed
Comment thread .github/workflows/deploy.yaml Dismissed
Comment thread .github/workflows/deploy.yaml Dismissed
Comment thread .github/workflows/deploy.yaml Dismissed
Comment thread .github/workflows/deploy.yaml Dismissed
Comment thread .github/workflows/deploy.yaml Dismissed
Comment thread .github/workflows/deploy.yaml Dismissed
- Change hadolint-action from commit SHA to v1.5.0 tag
- Change shellcheck from commit SHA to 2.0.0 tag
- Change prettier_action from commit SHA to v4.6 tag
- Fix YAML spacing for comments

This fixes the GitHub Actions errors where commit SHAs could not be resolved.
Comment thread .github/workflows/addon-ci.yml Dismissed
Comment thread .github/workflows/addon-ci.yml Dismissed
Comment thread .github/workflows/addon-ci.yml Dismissed
mistral-vibe and others added 5 commits May 25, 2026 22:20
…errors

The script was causing mypy import errors in pre-commit hooks.
This fixes the permission error in the zizmor security scanner.
Update the version of svenstaro/upload-release-action from v1-release to 2.11.5 to ensure compatibility with the latest GitHub Actions features and security improvements.
Comment thread .github/workflows/release.yml Dismissed
Comment thread .github/workflows/release.yml Dismissed
- Remove `security-events: write` permission from addon-ci.yml
- Update actions/checkout to use specific commit SHA in deploy.yaml
Comment thread .github/workflows/deploy.yaml Dismissed
mdeweerd added 2 commits May 26, 2026 01:28
Update the version of the publish-multi-arch-manifest action to a specific commit hash for better stability and reproducibility.
Added 'security-events: read' permission to allow the workflow to read security events. This is necessary for security-related workflows and integrations.
@mdeweerd
mdeweerd marked this pull request as ready for review May 26, 2026 00:11
@mdeweerd
mdeweerd merged commit e0476b6 into meters-to-ha May 26, 2026
21 of 22 checks passed
@mdeweerd
mdeweerd deleted the fix/deploy branch May 26, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants