mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-10 00:39:22 -06:00
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 7.0.9 to 7.0.11.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](84ae59a2cd...22a9089034)
---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
dependency-version: 7.0.11
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
83 lines
3.5 KiB
YAML
83 lines
3.5 KiB
YAML
name: Update frontend
|
|
|
|
on:
|
|
schedule: # once a day
|
|
- cron: "0 0 * * *"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
check-version:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
skip: ${{ steps.check_version.outputs.skip || steps.check_existing_pr.outputs.skip }}
|
|
current_version: ${{ steps.check_version.outputs.current_version }}
|
|
latest_version: ${{ steps.latest_frontend_version.outputs.latest_tag }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- name: Get latest frontend release
|
|
id: latest_frontend_version
|
|
uses: abatilo/release-info-action@32cb932219f1cee3fc4f4a298fd65ead5d35b661 # v1.3.3
|
|
with:
|
|
owner: home-assistant
|
|
repo: frontend
|
|
- name: Check if version is up to date
|
|
id: check_version
|
|
run: |
|
|
current_version="$(cat .ha-frontend-version)"
|
|
latest_version="${{ steps.latest_frontend_version.outputs.latest_tag }}"
|
|
echo "current_version=${current_version}" >> $GITHUB_OUTPUT
|
|
echo "LATEST_VERSION=${latest_version}" >> $GITHUB_ENV
|
|
if [[ ! "$current_version" < "$latest_version" ]]; then
|
|
echo "Frontend version is up to date"
|
|
echo "skip=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Check if there is no open PR with this version
|
|
if: steps.check_version.outputs.skip != 'true'
|
|
id: check_existing_pr
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
PR=$(gh pr list --state open --base main --json title --search "Update frontend to version $LATEST_VERSION")
|
|
if [[ "$PR" != "[]" ]]; then
|
|
echo "Skipping - There is already a PR open for version $LATEST_VERSION"
|
|
echo "skip=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
create-pr:
|
|
runs-on: ubuntu-latest
|
|
needs: check-version
|
|
if: needs.check-version.outputs.skip != 'true'
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
- name: Clear www folder
|
|
run: |
|
|
rm -rf supervisor/api/panel/*
|
|
- name: Update version file
|
|
run: |
|
|
echo "${{ needs.check-version.outputs.latest_version }}" > .ha-frontend-version
|
|
- name: Download release assets
|
|
uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
|
|
with:
|
|
repository: 'home-assistant/frontend'
|
|
tag: ${{ needs.check-version.outputs.latest_version }}
|
|
fileName: home_assistant_frontend_supervisor-${{ needs.check-version.outputs.latest_version }}.tar.gz
|
|
extract: true
|
|
out-file-path: supervisor/api/panel/
|
|
- name: Remove release assets archive
|
|
run: |
|
|
rm -f supervisor/api/panel/home_assistant_frontend_supervisor-*.tar.gz
|
|
- name: Create PR
|
|
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
|
|
with:
|
|
commit-message: "Update frontend to version ${{ needs.check-version.outputs.latest_version }}"
|
|
branch: autoupdate-frontend
|
|
base: main
|
|
draft: true
|
|
sign-commits: true
|
|
title: "Update frontend to version ${{ needs.check-version.outputs.latest_version }}"
|
|
body: >
|
|
Update frontend from ${{ needs.check-version.outputs.current_version }} to
|
|
[${{ needs.check-version.outputs.latest_version }}](https://github.com/home-assistant/frontend/releases/tag/${{ needs.check-version.outputs.latest_version }})
|
|
|