Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12c2bedb24 | |||
| 1b6a9efdd8 | |||
| 8f5b06b3a8 | |||
| 4b41db3a64 | |||
| 0e60d4c3c3 | |||
| 4262b2dad7 | |||
| 86cbe41ae5 | |||
| fd7fdfc6be | |||
| 5b7bef478f | |||
| 6ae22ec1fc | |||
| 1e95f06358 | |||
| ea8a5f5440 | |||
| 1713afdfdc | |||
| 71b0a020ee | |||
| 0e76be6bab | |||
| 706b504d38 | |||
| d7a9e8b399 | |||
| e0f43b9b12 | |||
| ad370db284 | |||
| c169682cb6 | |||
| 30ae1cb948 | |||
| ffdf0d45c9 | |||
| f1f8077ec5 | |||
| 16306e15f1 | |||
| 9514ca72ec | |||
| d77251e483 | |||
| 52cacd1233 | |||
| 8ecae4f00f | |||
| cc3990bb88 | |||
| ced928ab78 | |||
| 4b72039417 | |||
| 5791c02c40 | |||
| 809296d737 | |||
| db45c16e1e | |||
| 3886ae8f53 | |||
| 055f91b537 | |||
| 02d24a623e | |||
| 0c0abc63cd |
@@ -25,9 +25,6 @@
|
||||
- name: "maintenance"
|
||||
color: 2af79e
|
||||
description: "Generic maintenance tasks."
|
||||
- name: "chore"
|
||||
color: 2af79e
|
||||
description: "Generic chore."
|
||||
- name: "ci"
|
||||
color: 1d76db
|
||||
description: "Work that improves the continue integration."
|
||||
|
||||
@@ -21,7 +21,7 @@ categories:
|
||||
- "performance"
|
||||
- title: "🧰 Maintenance"
|
||||
labels:
|
||||
- "chore"
|
||||
- "maintenance"
|
||||
- "ci"
|
||||
- title: "📚 Documentation"
|
||||
labels:
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: Additional Tags
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
additional-tags:
|
||||
name: 🏷 Additional Tags
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.4.0
|
||||
- name: 🚀 Run Release Tracker
|
||||
uses: vweevers/additional-tags-action@v1.0.0
|
||||
@@ -16,8 +16,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
uses: actions/checkout@v2.4.0
|
||||
- name: 🚀 Run Label Syncer
|
||||
uses: micnncim/action-label-syncer@v1.2.0
|
||||
uses: micnncim/action-label-syncer@v1.3.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,26 +2,26 @@
|
||||
name: Lint
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on: [push, pull_request]
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: 🧹 yamllint
|
||||
yamllint:
|
||||
name: yamllint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
- name: 🚀 Run yamllint
|
||||
uses: frenck/action-yamllint@v1.0.1
|
||||
uses: frenck/action-yamllint@v1.1
|
||||
|
||||
prettier:
|
||||
name: 🧹 Prettier
|
||||
name: Prettier
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2.3.4
|
||||
uses: actions/checkout@v2.4.0
|
||||
- name: 🚀 Run Prettier
|
||||
uses: creyD/prettier_action@v3.3
|
||||
uses: creyD/prettier_action@v4.1.1
|
||||
with:
|
||||
prettier_options: --write **/*.{json,js,md,yaml}
|
||||
env:
|
||||
|
||||
@@ -12,10 +12,10 @@ jobs:
|
||||
name: 🔒 Lock closed issues and PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v2.0.3
|
||||
- uses: dessant/lock-threads@v3.0.0
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-lock-inactive-days: "30"
|
||||
issue-inactive-days: "30"
|
||||
issue-lock-reason: ""
|
||||
pr-lock-inactive-days: "1"
|
||||
pr-inactive-days: "1"
|
||||
pr-lock-reason: ""
|
||||
|
||||
@@ -13,6 +13,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Run Release Drafter
|
||||
uses: release-drafter/release-drafter@v5.13.0
|
||||
uses: release-drafter/release-drafter@v5.16.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Run stale
|
||||
uses: actions/stale@v3.0.14
|
||||
uses: actions/stale@v4
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 30
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: Test
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on: [push, pull_request]
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ⤵️ Check out code from GitHub
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
- name: 🚀 Run Home Assistant Configuration Check
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# MIT License
|
||||
|
||||
Copyright (c) 2021 Franck Nijhof
|
||||
Copyright (c) 2021-2022 Franck Nijhof
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -40,11 +40,12 @@ jobs:
|
||||
|
||||
## Arguments
|
||||
|
||||
| Input | Description | Usage |
|
||||
| :-------: | :------------------------------------------------------------------: | :--------: |
|
||||
| `path` | Path to the folder containing the Home Assistant Core configuration. | _Optional_ |
|
||||
| `secrets` | Alternative secrets file to use, e.g., "fakesecrets.yaml". | _Optional_ |
|
||||
| `version` | Version to use; dev/beta/stable or a specific version number. | _Optional_ |
|
||||
| Input | Description | Usage |
|
||||
| :--------: | :------------------------------------------------------------------: | :--------: |
|
||||
| `env_file` | Possible path to environment file to use. | _Optional_ |
|
||||
| `path` | Path to the folder containing the Home Assistant Core configuration. | _Optional_ |
|
||||
| `secrets` | Alternative secrets file to use, e.g., "fakesecrets.yaml". | _Optional_ |
|
||||
| `version` | Version to use; dev/beta/stable or a specific version number. | _Optional_ |
|
||||
|
||||
### Specific configuration folder
|
||||
|
||||
@@ -52,7 +53,7 @@ By default, this GitHub Action will use the root folder as the Home Assistant
|
||||
Core configuration folder. If you store your Home Assistant configuration in a
|
||||
subfolder, the `path` argument can be used to inform the Action about that.
|
||||
|
||||
For example, if you configuration is in the `config` folder:
|
||||
For example, if your configuration is in the `config` folder:
|
||||
|
||||
```yaml
|
||||
- name: 🚀 Run Home Assistant Core Configuration Check
|
||||
@@ -71,7 +72,7 @@ This GitHub Action offers a way around that, but using a fake secrets file.
|
||||
To use this, add a fake secrets file to your repository (e.g.,
|
||||
`fakesecrets.yaml`) and make sure the content is the same as your real
|
||||
`secrets.yaml` (with, of course, fake credentials/data). The GitHub Action
|
||||
will use this file during checking your configuration.
|
||||
will use this file while checking your configuration.
|
||||
|
||||
For example, if you fake secrets file is `fakesecrets.yaml`:
|
||||
|
||||
@@ -91,7 +92,7 @@ folder.
|
||||
|
||||
If the `.HA_VERSION` file is found, the version in that file is used. If
|
||||
the `.HA_VERSION` file is not found; the Action will use the latest stable
|
||||
version of Home Assistant to test your configuration with.
|
||||
version of Home Assistant to test your configuration.
|
||||
|
||||
However, you can specify/override any version you like to check against,
|
||||
for example, check with Home Assistant Core `2021.1.0`:
|
||||
@@ -104,7 +105,7 @@ for example, check with Home Assistant Core `2021.1.0`:
|
||||
```
|
||||
|
||||
Alternatively, you can also use `stable`, `beta` or `dev` to run against
|
||||
latest versions of those stability channels.
|
||||
the latest versions of those stability channels.
|
||||
|
||||
```yaml
|
||||
- name: 🚀 Run Home Assistant Core Configuration Check
|
||||
@@ -139,6 +140,20 @@ jobs:
|
||||
version: "${{ matrix.version }}"
|
||||
```
|
||||
|
||||
## Real-world examples
|
||||
|
||||
The following repositories are using this GitHub Action, and thus provide
|
||||
you with some real-world uses of this GitHub Action.
|
||||
|
||||
- [Frenck's Home Assistant Configuration](https://github.com/frenck/home-assistant-config)
|
||||
- [Klaasnicolaas - Student Home Assistant Configuration](https://github.com/klaasnicolaas/Student-homeassistant-config)
|
||||
- [Metbril's :sunglasses: Home Assistant Configuration](https://github.com/metbril/home-assistant-config)
|
||||
- [ntilley905's Home Assistant Configuration](https://github.com/ntilley905/hass)
|
||||
- [robbrad's Home Assistant Configuration](https://github.com/robbrad/HA-Config)
|
||||
|
||||
Are you using this GitHub Action? Feel free to open up a PR to add your
|
||||
configuration to this list 😍
|
||||
|
||||
## Changelog & Releases
|
||||
|
||||
This repository keeps a change log using [GitHub's releases][releases]
|
||||
@@ -152,6 +167,63 @@ based on the following:
|
||||
- `MINOR`: Backwards-compatible new features and enhancements.
|
||||
- `PATCH`: Backwards-compatible bugfixes and package updates.
|
||||
|
||||
## Versions & Updating
|
||||
|
||||
You can specify which version of this GitHub Action your workflow should use.
|
||||
And even allowing for using the latest major or minor version.
|
||||
|
||||
For example; this will use release `v1.1.1` of a GitHub Action:
|
||||
|
||||
```yaml
|
||||
- name: 🚀 Run Home Assistant Configuration Check
|
||||
uses: frenck/action-home-assistant@v1.1.1
|
||||
```
|
||||
|
||||
While the following example, will use the `v1.1.x` minor release, for example
|
||||
if `v1.1.2` is the latest releases (starting with `v1.1`), this will run
|
||||
`v1.1.2`:
|
||||
|
||||
```yaml
|
||||
- name: 🚀 Run Home Assistant Configuration Check
|
||||
uses: frenck/action-home-assistant@v1.1
|
||||
```
|
||||
|
||||
As in the examples throughout the documentation, the following example is
|
||||
locked on major version, meaning any `v1.x.x` latest version will be used,
|
||||
as long as it is version 1.
|
||||
|
||||
```yaml
|
||||
- name: 🚀 Run Home Assistant Configuration Check
|
||||
uses: frenck/action-home-assistant@v1
|
||||
```
|
||||
|
||||
### Automatically update using Dependabot
|
||||
|
||||
The advantage of locking against a more specific version, is that it prevents
|
||||
surprises if an issue or breaking changes were introduced in a newer release.
|
||||
|
||||
The disadvantage of being more specific, is that it requires you to keep things
|
||||
up to date. Fortunately, GitHub has a tool for that, called: Dependabot.
|
||||
|
||||
Dependabot can automatically open a pull request on your repository to update
|
||||
this Action for you. You can instantly see if the new version works (as the
|
||||
pull request shows the success or failure status) and you can decide to
|
||||
merge it in by hitting the merge button. Quick, easy and always up2date.
|
||||
|
||||
To enable Dependabot, create a file called `.github/dependabot.yaml`:
|
||||
|
||||
```yaml
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
```
|
||||
|
||||
Your all set! Dependabot will now check (and update) your GitHub actions
|
||||
every day. 🤩
|
||||
|
||||
## Contributing
|
||||
|
||||
This is an active open-source project. We are always open to people who want to
|
||||
@@ -173,7 +245,7 @@ check [the contributor's page][contributors].
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Franck Nijhof
|
||||
Copyright (c) 2021-2022 Franck Nijhof
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -198,7 +270,7 @@ SOFTWARE.
|
||||
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
|
||||
[github-sponsors]: https://github.com/sponsors/frenck
|
||||
[license-shield]: https://img.shields.io/github/license/frenck/action-home-assistant.svg
|
||||
[maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
|
||||
[maintenance-shield]: https://img.shields.io/maintenance/yes/2022.svg
|
||||
[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg
|
||||
[releases-shield]: https://img.shields.io/github/release/frenck/action-home-assistant.svg
|
||||
[releases]: https://github.com/frenck/action-home-assistant/releases
|
||||
|
||||
+18
-4
@@ -18,6 +18,9 @@ inputs:
|
||||
version:
|
||||
description: Version to use; dev/beta/stable or a specific version number
|
||||
required: false
|
||||
env_file:
|
||||
description: Possible path to environment file to use
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@@ -86,21 +89,32 @@ runs:
|
||||
fi
|
||||
echo "::set-output name=version::${version}"
|
||||
|
||||
docker pull "homeassistant/home-assistant:${version}"
|
||||
docker pull -q "ghcr.io/home-assistant/home-assistant:${version}"
|
||||
|
||||
- name: 🏗 Register Home Assistant problem matcher
|
||||
shell: bash
|
||||
run: |
|
||||
matcher="${{ github.action_path }}/matcher.json"
|
||||
echo "::add-matcher::${matcher}"
|
||||
|
||||
- name: 🚀 Run Home Assistant Configuration Check
|
||||
shell: bash
|
||||
# yamllint disable rule:line-length
|
||||
run: |
|
||||
docker run --rm \
|
||||
--entrypoint "" \
|
||||
"homeassistant/home-assistant:${{ steps.version.outputs.version }}" \
|
||||
"ghcr.io/home-assistant/home-assistant:${{ steps.version.outputs.version }}" \
|
||||
python -m homeassistant --version
|
||||
|
||||
env_file_arg=""
|
||||
if [[ -f "${{ inputs.env_file }}" ]]; then
|
||||
env_file_arg="--env-file ${{ inputs.env_file }}"
|
||||
fi
|
||||
docker run --rm \
|
||||
--entrypoint "" \
|
||||
-v $(pwd):/github/workspace \
|
||||
$env_file_arg \
|
||||
--workdir /github/workspace \
|
||||
"homeassistant/home-assistant:${{ steps.version.outputs.version }}" \
|
||||
"ghcr.io/home-assistant/home-assistant:${{ steps.version.outputs.version }}" \
|
||||
python -m homeassistant \
|
||||
--config "${{ steps.check.outputs.path }}" \
|
||||
--script check_config
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "homeassistant-warnings",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(WARNING):(.*)$",
|
||||
"severity": 1,
|
||||
"message": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "homeassistant-invalid-config",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "(Invalid config for .*) \\(See (.*)(?::|, line )(\\d|\\?)\\)",
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"message": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user