2023-03-29 01:31:07 +02:00
|
|
|
---
|
|
|
|
name: Synchronise Device Classes from Home Assistant
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
2023-09-13 00:06:32 +02:00
|
|
|
- cron: "45 6 * * *"
|
2023-03-29 01:31:07 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
sync:
|
|
|
|
name: Sync Device Classes
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-27 23:34:31 +02:00
|
|
|
if: github.repository == 'esphome/esphome'
|
2023-03-29 01:31:07 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-06-12 23:27:15 +02:00
|
|
|
uses: actions/checkout@v4.1.7
|
2023-03-29 01:31:07 +02:00
|
|
|
|
|
|
|
- name: Checkout Home Assistant
|
2024-06-12 23:27:15 +02:00
|
|
|
uses: actions/checkout@v4.1.7
|
2023-03-29 01:31:07 +02:00
|
|
|
with:
|
|
|
|
repository: home-assistant/core
|
2023-03-29 03:02:34 +02:00
|
|
|
path: lib/home-assistant
|
2023-03-29 01:31:07 +02:00
|
|
|
|
|
|
|
- name: Setup Python
|
2024-04-01 01:41:43 +02:00
|
|
|
uses: actions/setup-python@v5.1.0
|
2023-03-29 01:31:07 +02:00
|
|
|
with:
|
2024-04-15 23:42:15 +02:00
|
|
|
python-version: 3.12
|
2023-03-29 01:31:07 +02:00
|
|
|
|
|
|
|
- name: Install Home Assistant
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2023-03-29 03:02:34 +02:00
|
|
|
pip install -e lib/home-assistant
|
2023-03-29 01:31:07 +02:00
|
|
|
|
|
|
|
- name: Sync
|
|
|
|
run: |
|
|
|
|
python ./script/sync-device_class.py
|
|
|
|
|
|
|
|
- name: Commit changes
|
2024-05-29 07:11:02 +02:00
|
|
|
uses: peter-evans/create-pull-request@v6.0.5
|
2023-03-29 01:31:07 +02:00
|
|
|
with:
|
|
|
|
commit-message: "Synchronise Device Classes from Home Assistant"
|
|
|
|
committer: esphomebot <esphome@nabucasa.com>
|
|
|
|
author: esphomebot <esphome@nabucasa.com>
|
2023-05-16 01:30:25 +02:00
|
|
|
branch: sync/device-classes
|
2023-03-29 01:31:07 +02:00
|
|
|
delete-branch: true
|
|
|
|
title: "Synchronise Device Classes from Home Assistant"
|
2023-06-27 23:34:31 +02:00
|
|
|
body-path: .github/PULL_REQUEST_TEMPLATE.md
|
2023-05-16 01:30:25 +02:00
|
|
|
token: ${{ secrets.DEVICE_CLASS_SYNC_TOKEN }}
|