-
Notifications
You must be signed in to change notification settings - Fork 59
31 lines (29 loc) · 1.05 KB
/
bump-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 HEAD)"
echo "Branch: ${BRANCH}
Commit: ${COMMIT}" >| version.txt
- name: Push and commit
run: |
git commit -m "Auto version bump" -a
git push