-
-
Notifications
You must be signed in to change notification settings - Fork 503
49 lines (40 loc) · 1.65 KB
/
Copy pathupdate-badge.yml
File metadata and controls
49 lines (40 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Update Badge Workflow - Home Assistant version badge automation.
# Updates the repository badge when the workflow is triggered.
# -------------------------------------------------------------------
######################################################################
name: Update HA Version Badge
on:
push:
branches: [ "master" ] # If your default branch is "master", change this
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install Badgen
run: npm install -g badgen-cli
- name: Generate Badge
id: gen_badge
run: |
HA_VERSION=$(cat config/.HA_VERSION)
badgen --label "HA Version" --status "$HA_VERSION" --color "blue" > ha-version-badge.svg
echo "::set-output name=haVersion::$HA_VERSION"
- name: Commit and Push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ha-version-badge.svg
# Only commit if there's a change
git diff --quiet --cached || git commit -m "Update HA version badge to ${{ steps.gen_badge.outputs.haVersion }}"
git push