mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: Update README.md, strings.json, and services.yaml
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "README.md"
|
|
- "custom_components/adaptive_lighting/const.py"
|
|
- ".github/workflows/update-readme.yml"
|
|
pull_request:
|
|
|
|
jobs:
|
|
update_readme:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code from GitHub
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install Home Assistant
|
|
uses: ./.github/workflows/install_dependencies
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Run sync script
|
|
run: ./scripts/sync-strings
|
|
|
|
- name: Commit updated README.md, strings.json, and services.yaml
|
|
id: commit
|
|
run: |
|
|
git add -u .
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
if git diff --quiet && git diff --staged --quiet; then
|
|
echo "No changes in README.md, strings.json, and services.yaml, skipping commit."
|
|
echo "commit_status=skipped" >> $GITHUB_ENV
|
|
else
|
|
git commit -m "Update README.md, strings.json, and services.yaml"
|
|
echo "commit_status=committed" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Push changes
|
|
if: env.commit_status == 'committed'
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: ${{ github.head_ref }}
|