Skip to content
PlayFasterPublic

About

Shared Files for Project CI Validation for Home Assistant Custom Components

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

PlayFaster/.github

Latest Release License: Apache 2.0 Last Commit

Shared GitHub configuration for PlayFaster Home Assistant projects — reusable workflows and Dependabot config consumed by all integration and theme repos.

📋 Table of Contents

🔧 Reusable Workflows

Architecture

Validation is split across two files:

  • validate.yaml — master entry point called by every project stub. Accepts inputs and delegates to validate-specific.yaml.
  • validate-specific.yaml — contains all 9 jobs. The category input controls which jobs run per project type.

Project stubs always call validate.yaml — the internal split is invisible to callers.

Inputs

Input Required Default Description
category No integration Project type: integration, theme, or standard
component_name No "" Component directory name (e.g., wifi_ssid_monitor) — integration only
gist_id No "" Gist ID for the dynamic coverage badge — integration only

Secrets

Secret Required Description
GIST_SECRET No GitHub token with gist write access — integration only

Integration stubs pass GIST_SECRET explicitly. Theme stubs pass no secrets.

Usage — Integration

Pin to a full commit SHA for immutability — tags can be moved, but a SHA is permanent. Record the corresponding branch and version in a comment:

jobs:
  validate:
    # Branch @main v2.0.2
    uses: PlayFaster/.github/.github/workflows/validate.yaml@<sha>
    with:
      category: integration
      component_name: wifi_ssid_monitor
      gist_id: <your-gist-id>
    secrets:
      GIST_SECRET: ${{ secrets.GIST_SECRET }}

Usage — Theme

jobs:
  validate:
    # Branch @main v2.0.3
    uses: PlayFaster/.github/.github/workflows/validate.yaml@<sha>
    with:
      category: theme

Usage — Standard (Self-Validation)

Used for basic validation of non-Home-Assistant repositories (such as the .github repository itself):

jobs:
  validate:
    uses: PlayFaster/.github/.github/workflows/validate.yaml@<sha>
    with:
      category: standard

Note

For integration and theme categories, the calling repo must supply a .validate/ directory containing:

  • hacs_schema.json and ha_manifest_schema.json — JSON schemas for the file integrity job
  • .yamllint — YAML lint rules
  • .prettierrc.json — Prettier config covering *.json, *.yaml, *.yml
  • .mlc_config.json — markdown-link-check config

Integration repos also need requirements_test.txt and a root pyproject.toml with [tool.codespell]. Theme repos need a root pyproject.toml with [tool.codespell].

✅ Validation Jobs

Job Tool Category Blocking
zizmor Zizmor (workflow security audit) All Yes
hassfest home-assistant/actions/hassfest Integration Yes
hacs_val hacs/action (category passed through) Integration, Theme Yes
py_val Ruff Integration Yes
test_val pytest + coverage badge (Gist) Integration Yes
file_val check-jsonschema, yamllint, Prettier, markdown-link-check All (HACS/HA schema checks skipped for standard) Yes
codespell codespell-project/actions-codespell All Yes
mypy_val Mypy Integration Yes
structure_val Theme directory structure check Theme Yes

Pinning

Every uses: reference is pinned to a full commit SHA, with the human-readable version in a comment on the preceding line (# Tag @v7.0.1, or # Branch @main v2.0.2 for stubs referencing this repo).

Every pip-installed tool and npm package is likewise pinned to an exact version (ruff==n.nn.nn, prettier@n.n.n, and so on) inside validate-specific.yaml. Those pins are not repeated here — that file is the single source of truth, and duplicating version numbers into the docs only creates a second place to update on every bump. To read the current set:

grep -n "pip install \|npm install " .github/workflows/validate-specific.yaml

🧩 Other Workflows

Besides the validation pair, this repo ships:

Workflow Trigger Purpose
codeql.yaml workflow_call Reusable CodeQL analysis (Python) for integration repos, called by each repo's own codeql.yml. Separate entry point — not reached via validate.yaml. Its analyze job needs security-events: write to upload SARIF results; every validation job is read-only.
validate-self.yaml push (main, dev), pull_request, weekly cron Validates this repository itself by calling the local validate.yaml with category: standard.

🔄 Dependabot

Monitors github-actions, pip, and pre-commit ecosystems on a weekly schedule with a 7-day cool-down between updates.

📄 License

License: Apache 2.0

This project is licensed under the Apache License, Version 2.0. See LICENSE for details.

About

Shared Files for Project CI Validation for Home Assistant Custom Components

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages