EcoAssist v5.28 #12
Workflow file for this run
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 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 the latest version of main | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Checkout the main branch explicitly | |
run: | | |
git checkout main | |
git pull origin main --rebase # Ensure you're up to date with the remote | |
- 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 main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |