Skip to content

Commit 828f593

Browse files
authored
Add workflow to bump version on merge to master
1 parent b8e6dea commit 828f593

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Bump version on merge
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
bump-version:
13+
name: Bump version in config
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
ref: master
20+
fetch-tags: true
21+
22+
- name: Update version in config
23+
run: |
24+
version="$(git describe --tags --abbrev=0)-$(git rev-parse --abbrev-ref HEAD)-$(date -u -Iseconds)"
25+
sed -i "s/GRUB_BTRFS_VERSION=.*/GRUB_BTRFS_VERSION=${version}/" config
26+
27+
- name: Commit updated config
28+
run: |
29+
git config user.name "github-actions[bot]"
30+
git config user.email "github-actions[bot]@users.noreply.github.com"
31+
git add config
32+
git commit -m "chore: bump version to ${version}"
33+
git push origin master

0 commit comments

Comments
 (0)