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
|
2023-10-19 02:08:15 +02:00
|
|
|
uses: actions/checkout@v4.1.1
|
2023-03-29 01:31:07 +02:00
|
|
|
|
|
|
|
- name: Checkout Home Assistant
|
2023-10-19 02:08:15 +02:00
|
|
|
uses: actions/checkout@v4.1.1
|
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
|
2023-12-07 02:08:50 +01:00
|
|
|
uses: actions/setup-python@v5.0.0
|
2023-03-29 01:31:07 +02:00
|
|
|
with:
|
|
|
|
python-version: 3.11
|
|
|
|
|
|
|
|
- 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-03-14 05:28:05 +01:00
|
|
|
uses: peter-evans/create-pull-request@v6.0.2
|
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 }}
|