2023-03-29 01:31:07 +02:00
|
|
|
---
|
|
|
|
name: Synchronise Device Classes from Home Assistant
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '45 6 * * *'
|
|
|
|
|
|
|
|
|
|
|
|
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-09-05 08:11:46 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-03-29 01:31:07 +02:00
|
|
|
|
|
|
|
- name: Checkout Home Assistant
|
2023-09-05 08:11:46 +02:00
|
|
|
uses: actions/checkout@v4
|
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
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
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
|
2023-04-13 10:12:24 +02:00
|
|
|
uses: peter-evans/create-pull-request@v5
|
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 }}
|