File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ commit = true
16
16
message = " Bump version: {current_version} → {new_version}"
17
17
commit_args = " --no-verify"
18
18
setup_hooks = []
19
- pre_commit_hooks = []
19
+ pre_commit_hooks = [" bash scripts/pre-commit/inject-commit-sha.bash " ]
20
20
post_commit_hooks = []
21
21
22
22
[[tool .bumpversion .files ]]
Original file line number Diff line number Diff line change 14
14
** /CODE_OF_CONDUCT.md
15
15
** /CONTRIBUTING.md
16
16
** /SECURITY.md
17
- ** /README.md
17
+ ** /README.md
18
+ ** /LICENSE
19
+ ** /scripts
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+ set -o pipefail
5
+ set -o errexit
6
+ set -o nounset
7
+
8
+ target_file=" internal/release/release.go"
9
+ latest_sha=$( git rev-parse HEAD)
10
+
11
+ sed -i ' ' " s/var BuildInformation = \" .*\" /var BuildInformation = \" ${latest_sha} \" /" " ${target_file} "
12
+
13
+ if git diff --quiet " ${target_file} " ; then
14
+ exit 0
15
+ else
16
+ git add " ${target_file} "
17
+ fi
You can’t perform that action at this time.
0 commit comments