Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,44 @@ jobs:
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check out default branch
uses: actions/checkout@v6
with:
ref: ${{ github.event.repository.default_branch }}
- name: Update README release links
env:
TAG: ${{ inputs.tag || github.event.release.tag_name }}
run: |
python - <<'PY'
from pathlib import Path
import re
import os

tag = os.environ["TAG"]
readme = Path("README.md")
content = readme.read_text()
tag_pattern = r"v?[0-9]+(?:\.[0-9]+){2}(?:[-+][A-Za-z0-9._-]+)?"
content = re.sub(
rf"https://github\.com/aperiodic-io/cli/releases/tag/{tag_pattern}",
f"https://github.com/aperiodic-io/cli/releases/tag/{tag}",
content,
)
content = re.sub(
rf"https://github\.com/aperiodic-io/cli/releases/download/{tag_pattern}",
f"https://github.com/aperiodic-io/cli/releases/download/{tag}",
content,
)
readme.write_text(content)
PY
- name: Commit README update
env:
TAG: ${{ inputs.tag || github.event.release.tag_name }}
run: |
if git diff --quiet README.md; then
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "docs: update README release links for ${TAG}"
git push