Setting up your github repository to perform actions on a new HA release

Hi,
Following a question by allanparsson

, i looked into how to trigger actions on your own repository (or any repository you own) after a new HA release, it turns out you can, using 2 actions.

Inspired from:

The first one will check for a new HA release and commit a new
release-versions/home-assistant-latest.txt
file if an update is found:
(don’t forget to replace your user name below)

check_ha_release.yml:

name: Get HA latest release version
on:
  schedule:
    - cron:  '0 10 * * *'
jobs:
  get-version:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
      - name: Fetch release version
        run: |
          curl -sL https://api.github.com/repos/home-assistant/home-assistant/releases/latest | \
          jq -r ".tag_name" > release-versions/home-assistant-latest.txt
      - name: Check for modified files
        id: git-check
        run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
      - name: Commit latest release version
        if: steps.git-check.outputs.modified == 'true'
        run: |
          git config --global user.name 'GitHub'
          git config --global user.email '[email protected]'
          git remote set-url origin https://x-access-token:${{ secrets.REPO_SCOPED_TOKEN }}@github.com/$GITHUB_REPOSITORY
          git checkout "${GITHUB_REF:11}"
          git commit -am "New release version"
          git push

This will in turn be used to trigger the second action which you can use to do more custom actions, like checking your config files with the following trigger:

check_config_on_release.yml:

on:
  push:
    paths:
      - 'release-versions/*'

  home_assistant_stable:
    name: "Home-Assistant: Stable"
    runs-on: ubuntu-latest
    steps:
      - name: Getting your configuration from GitHub
        uses: actions/[email protected]
      - name: Copy stub files into configuration folder
        run: cp -R ./.stubs/* ./config
      - name: Home Assistant Version
        uses: "docker://homeassistant/home-assistant:stable"
        with:
          args: >
            python -m homeassistant --version
      - name: Home Assistant Check
        uses: "docker://homeassistant/home-assistant:stable"
        with:
          args: python -m homeassistant --config ./config/ --script check_config --info all

Cheers

Thanks for your help in my issue, I’ll look at it the coming days :pray::heart:

Hello

I’ve tried running this on my config but running into some issues

  • Platform error sensor.plex_recently_added - Integration ‘plex_recently_added’ not found.
  • Platform error sensor.calendarific - Integration ‘calendarific’ not found.
  • Component error: calendarific - Integration ‘calendarific’ not found.
  • Component error: hacs - Integration ‘hacs’ not found.
    http:
  • Invalid config for [http]: not a file for dictionary value @ data[‘http’][‘ssl_certificate’]. Got ‘/config/’
  • not a file for dictionary value @ data[‘http’][‘ssl_key’]. Got ‘/config/’. (See /github/workspace/./config/configuration.yaml, line 1917).

How have you had any of these issues ?