This repository was archived by the owner on Apr 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.1.7 2020-12-04
2
+
3
+ * Fixed a bug where we could not figure out what Docker image version to
4
+ use. The method we used to use stopped working at some point, so I had to
5
+ find a new creative way to find the corresponding branch in a detached git
6
+ checkout.
7
+
8
+
1
9
## 0.1.6 2020-04-19
2
10
3
11
* Fixed a bug that caused macOS builds to fail semi-randomly (after the first
Original file line number Diff line number Diff line change @@ -20,10 +20,17 @@ jobs:
20
20
echo "Setting image version from tag - $tag"
21
21
image_version=$tag
22
22
else
23
- # Our checkout is in a detached head state, and this is the
24
- # only way I've found to get the branch name in that case.
25
- refs=$( git describe --all )
26
- branch=$( echo "$refs" | sed 's/^remotes\/origin\///' )
23
+ # Our checkout is in a detached head state, so we need to
24
+ # figure out what branch it corresponds to in the remote.
25
+
26
+ # Get all the remote branch names.
27
+ remote_heads="$( git ls-remote --heads origin )"
28
+ # Get the commit SHA for our local checkout.
29
+ local_head_ref="$( git rev-parse HEAD )"
30
+ # Find the first match in our remote heads for our local checkout.
31
+ our_head="$( echo "$remote_heads" | grep $local_head_ref | head -1 )"
32
+ # Extract branch name from the heads info.
33
+ branch=$( echo "$our_head" | cut -d / -f 3 )
27
34
echo "Setting image version from branch name - $branch"
28
35
image_version=$branch
29
36
fi
You can’t perform that action at this time.
0 commit comments