Update from base builder #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Update Readme" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '.github/tpl/*' | |
- '.github/data/*' | |
- '.github/workflows/readme.yml' | |
release: | |
types: [ published ] | |
jobs: | |
readme: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get latest release | |
id: get-latest-release | |
uses: InsonusK/get-latest-release@v1.0.1 | |
with: | |
myToken: ${{ github.token }} | |
view_top: 1 | |
- name: Using main branch | |
run: | | |
git switch main || (git fetch --all && git checkout -b main origin/main) | |
echo "LATEST_MAJOR=$(echo ${{ steps.get-latest-release.outputs.tag_name }} | cut -d . -f 1)" >> $GITHUB_ENV | |
echo "LATEST_TAG=${{ steps.get-latest-release.outputs.tag_name }}" >> $GITHUB_ENV | |
latest=$(ls conf/*.conf | tail -1) | |
echo "LATEST_CONF=$latest" >> $GITHUB_ENV | |
- name: Update the readme.md | |
uses: vmactions/render@v0.0.1 | |
with: | |
datafile: .github/data/datafile.ini | |
files: | | |
.github/tpl/README.tpl.md : README.md | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
message: "Update version to ${{ steps.get-latest-release.outputs.tag_name }}" | |
pull: '--rebase --autostash ' | |
add: | | |
README.md | |