Skip to content

Update update-readme.yml #6

Update update-readme.yml

Update update-readme.yml #6

Workflow file for this run

name: Update README with Latest Version
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extract latest version
id: get_version
run: |
echo "## Current Version: $(git describe --tags --abbrev=0)" > VERSION
echo "**Release Date:** $(date +'%a, %b %d, %Y')" > DATE
- name: Update README
run: |
version=$(cat VERSION)
date=$(cat DATE)
sed -i 's/## Current Version:.*/## Current Version: '"${version}"'/' .github/README.md
sed -i 's/**Release Date:**.*/**Release Date:** '"${date}"'/' .github/README.md
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .github/README.md
git commit -m "Update README with latest version and date"
git push