File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,23 @@ jobs:
40
40
- name : Check version pinning
41
41
shell : bash
42
42
run : |
43
- gh codeql set-version v2.5.9
43
+ # Set the version without a v prefix
44
+ gh codeql set-version 2.5.9
44
45
VERSION=`gh codeql version --format json | jq -r '.version'`
45
46
if [[ $VERSION != "2.5.9" ]]; then
46
47
echo "::error::Expected version 2.5.9 but got $VERSION"
47
48
exit 1
48
49
fi
50
+ gh codeql list-installed | grep v2.5.9
51
+
52
+ # Set the version with a v prefix
53
+ COUNT_BEFORE=`gh codeql list-installed | wc -l`
54
+ gh codeql set-version v2.5.9
55
+ COUNT_AFTER=`gh codeql list-installed | wc -l`
56
+ if [[ $COUNT_BEFORE != $COUNT_BEFORE ]]; then
57
+ echo "::error::Installing an already installed version changed the number of installed versions from $COUNT_BEFORE to $COUNT_AFTER!"
58
+ exit 1
59
+ fi
49
60
50
61
- name : Check version unpinning
51
62
shell : bash
56
67
echo "::error::Expected latest version but got 2.5.9"
57
68
exit 1
58
69
fi
70
+
71
+ - name : Check getting nightly version
72
+ shell : bash
73
+ run : |
74
+ gh codeql set-channel nightly
75
+ gh codeql set-version codeql-bundle-20210831-manual
76
+ VERSION=`gh codeql version --format json | jq -r '.version'`
77
+ if [[ $VERSION != "2.6.0+202108311306" ]]; then
78
+ echo "::error::Expected version 2.6.0+202108311306 but got $VERSION"
79
+ exit 1
80
+ fi
Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ function set_version() {
122
122
elif [ " $version " = " latest" ]; then
123
123
version=" $( gh api " repos/$repo /releases/latest" --jq " .tag_name" ) "
124
124
fi
125
+ if [ $repo = ' github/codeql-cli-binaries' ] && [[ " $version " != v* ]] ; then
126
+ # Versions in github/codeql-cli-binaries have tags prefixed with v; we add this in if the user forgot.
127
+ version=" v$version "
128
+ fi
125
129
download " $version "
126
130
gh config set extensions.codeql.version " $version "
127
131
}
141
145
142
146
# Handle the list-installed command.
143
147
if [ " $1 " = " list-installed" ]; then
144
- ( cd " $rootdir /dist/$channel " ; find . -depth 1 -type d | cut -c3- ; )
148
+ ( cd " $rootdir /dist/$channel " ; find . -mindepth 1 -maxdepth 1 -type d | cut -c3- ; )
145
149
exit 0
146
150
fi
147
151
You can’t perform that action at this time.
0 commit comments