Skip to content

Update version text file #2

Update version text file

Update version text file #2

name: Update version text file
on:
workflow_dispatch:
release:
types:
- published
jobs:
replace-txt:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Replace contents of version.txt
run: |
RAW_VERSION=${{ env.RELEASE_VERSION }}
CLEAN_VERSION="${RAW_VERSION#v}"
echo "$CLEAN_VERSION" > version.txt
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add version.txt
git commit -m "Version tag update (GitHub actions)"
- name: Push changes
run: |
git push origin HEAD:refs/heads/main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}