File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " setup-git-for-windows-sdk" ,
3
- "version" : " 0.0.0 " ,
3
+ "version" : " 0.0.9 " ,
4
4
"private" : true ,
5
5
"description" : " Set up an environment to develop Git for WindowsTypeScript template action" ,
6
6
"main" : " lib/main.js" ,
Original file line number Diff line number Diff line change @@ -9,9 +9,26 @@ die () {
9
9
exit 1
10
10
}
11
11
12
+ LF='
13
+ '
14
+
12
15
git diff --no-index --quiet pre-push.hook " $( git rev-parse --git-path hooks/pre-push) " ||
13
16
die ' The `pre-push` hook is not up to date with `pre-push.hook`'
14
17
18
+ # Verify that any tagged version is reflected in its `package.json`
19
+ for tag in $( git for-each-ref --format=' %(refname:short)' --points-at=HEAD ' refs/tags/v[0-9]*' )
20
+ do
21
+ out=" $( git tag --verify $tag 2>&1 ) " ||
22
+ die " $out$LF ${LF} Tag $tag is not signed/signature cannot be verified"
23
+
24
+ git grep -q ' "version": "' " ${tag# v} " ' "' refs/tags/$tag -- package.json || {
25
+ sed ' s/\("version": "\)[^"]*/\1' " ${tag# v} " / < package.json > package.json.new &&
26
+ mv -f package.json.new package.json
27
+ die " package.json did not reflect $tag ; It was adjusted."
28
+ exit 1
29
+ }
30
+ done
31
+
15
32
git diff --quiet dist/ ||
16
33
die ' `dist/` is dirty'
17
34
You can’t perform that action at this time.
0 commit comments