From 032951882f34e980320bdf54f6a3dce0aef44c0d Mon Sep 17 00:00:00 2001 From: superdooper86 Date: Thu, 7 May 2026 23:17:02 +0200 Subject: [PATCH] Add beta badge to README, managed by workflows --- .github/workflows/release-beta.yml | 20 ++++++++++++++++++-- .github/workflows/release.yml | 5 +++++ README.md | 1 + 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 62c79e4..64f02d2 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -54,10 +54,26 @@ jobs: --arg notes "$notes" \ '{version: $version, url: $url, notes: $notes}' > version-beta.json - - name: Commit version-beta.json + - name: Update beta badge in README + run: | + shields_version=$(echo "${{ steps.version.outputs.version }}" | sed 's/-/--/g') + tag="${{ github.ref_name }}" + badge="[![Beta](https://img.shields.io/badge/beta-${shields_version}-orange?style=flat)](https://github.com/${{ github.repository }}/releases/tag/${tag}) " + python3 -c " +lines = open('README.md').readlines() +out = [] +for line in lines: + if '' in line: + out.append('${badge}\n') + else: + out.append(line) +open('README.md', 'w').writelines(out) +" + + - name: Commit version-beta.json and README run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add version-beta.json + git add version-beta.json README.md git commit -m "Beta release ${{ github.ref_name }}" git push origin HEAD:main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39aa71f..2b25be9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,6 +70,11 @@ jobs: sed -i '' \ 's/version-[0-9][^-]*-orange/version-${{ steps.version.outputs.version }}-orange/' \ README.md + # Remove beta badge now that stable is released + sed -i '' '//d' README.md + # Re-add empty marker so future betas can target it + sed -i '' '/license-MIT-blue/a\ +' README.md - name: Commit version.json and README run: | diff --git a/README.md b/README.md index 4367323..9c22339 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ [![Swift](https://img.shields.io/badge/Swift-5.9-F05138?style=flat&logo=swift&logoColor=white)](https://swift.org) [![Version](https://img.shields.io/badge/version-1.1.2-orange?style=flat)](https://github.com/superdooper86/claudechecker/releases) [![License](https://img.shields.io/badge/license-MIT-blue?style=flat)](LICENSE) +