This commit is contained in:
CCOSTAN 2024-12-24 16:51:08 +00:00
commit 89409b1176
3 changed files with 60 additions and 1 deletions

42
.github/workflows/update-badge.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Update HA Version Badge
on:
push:
branches: [ "master" ] # If your default branch is "master", change this
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
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

View File

@ -9,7 +9,8 @@
[![X Follow](https://img.shields.io/twitter/follow/ccostan?color=blue&label=talk&logo=twitter&style=for-the-badge)](https://x.com/ccostan) [![X Follow](https://img.shields.io/twitter/follow/ccostan?color=blue&label=talk&logo=twitter&style=for-the-badge)](https://x.com/ccostan)
[![YouTube Subscribe](https://img.shields.io/youtube/channel/subscribers/UC301G8JJFzY0BZ_0lshpKpQ?label=VIEW&logo=Youtube&logoColor=%23DF5D44&style=for-the-badge)](https://www.youtube.com/vCloudInfo?sub_confirmation=1) [![YouTube Subscribe](https://img.shields.io/youtube/channel/subscribers/UC301G8JJFzY0BZ_0lshpKpQ?label=VIEW&logo=Youtube&logoColor=%23DF5D44&style=for-the-badge)](https://www.youtube.com/vCloudInfo?sub_confirmation=1)
[![GitHub Follow](https://img.shields.io/github/stars/CCOSTAN/Home-AssistantConfig?label=sTARS&amp;logo=Github&amp;style=for-the-badge)](https://github.com/CCOSTAN) [![GitHub Follow](https://img.shields.io/github/stars/CCOSTAN/Home-AssistantConfig?label=sTARS&amp;logo=Github&amp;style=for-the-badge)](https://github.com/CCOSTAN) <br>
[![HA Version Badge](https://raw.githubusercontent.com/ccostan/home-assistantconfig/master/ha-version-badge.svg)](https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/.HA_VERSION)
<h4> <h4>
<a href="https://github.com/CCOSTAN/Home-AssistantConfig/commits/master"><img src="https://img.shields.io/github/last-commit/CCOSTAN/Home-AssistantConfig.svg?style=plasticr"/></a> <a href="https://github.com/CCOSTAN/Home-AssistantConfig/commits/master"><img src="https://img.shields.io/github/last-commit/CCOSTAN/Home-AssistantConfig.svg?style=plasticr"/></a>

16
ha-version-badge.svg Normal file
View File

@ -0,0 +1,16 @@
<svg width="68.5" height="20" viewBox="0 0 685 200" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="2024.12.4">
<title>2024.12.4</title>
<linearGradient id="XDrPo" x2="0" y2="100%">
<stop offset="0" stop-opacity=".1" stop-color="#EEE"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="fmyBb"><rect width="685" height="200" rx="30" fill="#FFF"/></mask>
<g mask="url(#fmyBb)">
<rect width="685" height="200" fill="#08C" x="0"/>
<rect width="685" height="200" fill="url(#XDrPo)"/>
</g>
<g aria-hidden="true" fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110">
<text x="65" y="148" textLength="570" fill="#000" opacity="0.25">2024.12.4</text>
<text x="55" y="138" textLength="570">2024.12.4</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 815 B