Update update_latest_versions.yml #4
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 Latest Version | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
update_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Extract version number | |
id: extract_version | |
run: | | |
echo "::set-output name=version::${{ github.ref }}" | |
- name: Format version number | |
id: format_version | |
run: | | |
formatted_version=$(echo ${{ steps.extract_version.outputs.version }} | sed 's/refs\/tags\///') | |
echo "::set-output name=formatted_version::$formatted_version" | |
- name: Update version | |
run: echo ${{ steps.format_version.outputs.formatted_version }} > latest_version.txt | |
- name: Commit and push changes | |
run: | | |
git config user.name "GitHub Action" | |
git config user.email "action@github.com" | |
git add latest_version.txt | |
git commit -m "Update latest version" | |
git push |