Update bump-version.yml #15
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: bump-version | |
# Controls when the workflow will run | |
on: | |
push: | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
version-bump: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# Runs a set of commands using the runners shell | |
- name: Configure name and email | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Save version file | |
run: | | |
BRANCH="$(git branch --show-current)" | |
COMMIT="$(git rev-list --count --remotes)" | |
echo "Branch: ${BRANCH} | |
Commit: ${COMMIT}" >| version.txt | |
- name: Push and commit | |
run: | | |
git commit -m "Auto version bump" -a | |
git push |