Fix YAML syntax in stable workflow — indent Python, use env var for version
This commit is contained in:
@@ -66,21 +66,24 @@ jobs:
|
|||||||
../homebrew-tap/Casks/claudechecker.rb 2>/dev/null || true
|
../homebrew-tap/Casks/claudechecker.rb 2>/dev/null || true
|
||||||
|
|
||||||
- name: Update README badge
|
- name: Update README badge
|
||||||
|
env:
|
||||||
|
NEW_VERSION: ${{ steps.version.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
python3 -c "
|
python3 -c "
|
||||||
content = open('README.md').read()
|
import os, re
|
||||||
import re
|
v = os.environ['NEW_VERSION']
|
||||||
content = re.sub(r'version-[0-9][^-]*-orange', 'version-${{ steps.version.outputs.version }}-orange', content)
|
content = open('README.md').read()
|
||||||
lines = content.splitlines(keepends=True)
|
content = re.sub(r'version-[0-9][^-]*-orange', 'version-' + v + '-orange', content)
|
||||||
out = []
|
lines = content.splitlines(keepends=True)
|
||||||
for line in lines:
|
out = []
|
||||||
if '<!-- BETA_BADGE -->' in line:
|
for line in lines:
|
||||||
continue
|
if '<!-- BETA_BADGE -->' in line:
|
||||||
out.append(line)
|
continue
|
||||||
if 'license-MIT-blue' in line:
|
out.append(line)
|
||||||
out.append('<!-- BETA_BADGE -->\n')
|
if 'license-MIT-blue' in line:
|
||||||
open('README.md', 'w').writelines(out)
|
out.append('<!-- BETA_BADGE -->' + chr(10))
|
||||||
"
|
open('README.md', 'w').writelines(out)
|
||||||
|
"
|
||||||
|
|
||||||
- name: Commit version.json and README
|
- name: Commit version.json and README
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user