Update #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update | |
on: | |
schedule: | |
- cron: '45 9 * * 1-4' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
base_image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Current version | |
id: current | |
run: | | |
echo "version=$(head -n 1 Dockerfile | cut -d ':' -f 2)" >> $GITHUB_OUTPUT | |
- name: Available version | |
id: available | |
run: | | |
echo "version=$(curl -sSL https://version.home-assistant.io/beta.json | jq -r '.homeassistant.default')" >> $GITHUB_OUTPUT | |
- name: Update Dockerfile | |
if: ${{ steps.current.outputs.version != steps.available.outputs.version }} | |
run: | | |
sed -i 's/${{ steps.current.outputs.version }}/${{ steps.available.outputs.version }}/' Dockerfile | |
- name: Create Pull Request | |
if: ${{ steps.current.outputs.version != steps.available.outputs.version }} | |
uses: peter-evans/[email protected] | |
with: | |
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" | |
commit-message: "Update base image to ${{ steps.available.outputs.version }}" | |
title: "Update base image to ${{ steps.available.outputs.version }}" | |
body: "Update base image to ${{ steps.available.outputs.version }}" | |
branch: "update-base-image-${{ steps.available.outputs.version }}" | |
base: "main" |