Workflow file for this run
This file contains hidden or 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: Sync version.txt with release tag | |
| permissions: | |
| contents: write | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| update-version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| ref: main | |
| - name: Extract tag version | |
| run: echo "RELEASE_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV | |
| - name: Update version.txt | |
| run: echo "${RELEASE_VERSION}" > version.txt | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add version.txt | |
| git commit -m "chore: update version.txt to $RELEASE_VERSION" || echo "No changes to commit" | |
| git push origin main |