-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.4 KB
/
check_homeassistant.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: 'check home-assistant configuration'
on:
pull_request_target:
workflow_dispatch:
jobs:
homeassistant:
name: 'validate home-assistant configuration'
runs-on: ubuntu-latest
steps:
- name: 'workaround for nektos/act'
run: |
if [ ! -f "/etc/lsb-release" ] ; then
echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
fi
- name: 'checkout'
uses: actions/checkout@v4
- run: mv secrets secrets.old || true
- run: mkdir secrets
- run: cp -v ci/secrets.yaml secrets.yaml
- run: cp -v ci/google-cloud-tts.json secrets/google-cloud-tts.json
- run: cp -v ci/google-assistant.json secrets/google-assistant.json
- name: 'check homeassistant config'
id: check
uses: frenck/action-home-assistant@v1
continue-on-error: true
- name: 'comment on PR'
if: github.event_name == 'pull_request_target'
uses: actions/github-script@v7
with:
script: |
const commentContent = `config check: ${{ steps.check.outcome }}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentContent
})
- name: 'fail if config validation fails'
if: steps.check.outcome == 'failure'
run: exit 1