Skip to content

Commit fdcc847

Browse files
chore(release): 5.5.0 (#1865)
1 parent 2b79379 commit fdcc847

File tree

4 files changed

+123
-100
lines changed

4 files changed

+123
-100
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## v5.5.0
2+
3+
### What's Changed
4+
* feat: upgrade wrapper to 0.2.4 by @jviall in https://github.com/codecov/codecov-action/pull/1864
5+
* Pin actions/github-script by Git SHA by @martincostello in https://github.com/codecov/codecov-action/pull/1859
6+
* fix: check reqs exist by @joseph-sentry in https://github.com/codecov/codecov-action/pull/1835
7+
* fix: Typo in README by @spalmurray in https://github.com/codecov/codecov-action/pull/1838
8+
* docs: Refine OIDC docs by @spalmurray in https://github.com/codecov/codecov-action/pull/1837
9+
* build(deps): bump github/codeql-action from 3.28.17 to 3.28.18 by @app/dependabot in https://github.com/codecov/codecov-action/pull/1829
10+
11+
12+
**Full Changelog**: https://github.com/codecov/codecov-action/compare/v5.4.3..v5.5.0
13+
14+
115
## v5.4.3
216

317
### What's Changed

dist/codecov.sh

Lines changed: 107 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ g="\033[0;32m" # info/debug
3737
r="\033[0;31m" # errors
3838
x="\033[0m"
3939
retry="--retry 5 --retry-delay 2"
40-
CC_WRAPPER_VERSION="0.2.4"
40+
CC_WRAPPER_VERSION="0.2.7"
4141
CC_VERSION="${CC_VERSION:-latest}"
4242
CC_FAIL_ON_ERROR="${CC_FAIL_ON_ERROR:-false}"
4343
CC_RUN_CMD="${CC_RUN_CMD:-upload-coverage}"
44+
CC_CLI_TYPE=${CC_CLI_TYPE:-"codecov-cli"}
4445
say " _____ _
4546
/ ____| | |
4647
| | ___ __| | ___ ___ _____ __
@@ -49,22 +50,26 @@ say " _____ _
4950
\\_____\\___/ \\__,_|\\___|\\___\\___/ \\_/
5051
$r Wrapper-$CC_WRAPPER_VERSION$x
5152
"
53+
if [[ "$CC_CLI_TYPE" != "codecov-cli" && "$CC_CLI_TYPE" != "sentry-prevent-cli" ]]; then
54+
echo "Invalid CC_CLI_TYPE: '$CC_CLI_TYPE'. Must be 'codecov-cli' or 'sentry-prevent-cli'"
55+
exit 1
56+
fi
5257
if [ -n "$CC_BINARY" ];
5358
then
5459
if [ -f "$CC_BINARY" ];
5560
then
56-
c_filename=$CC_BINARY
57-
c_command=$CC_BINARY
61+
CC_FILENAME=$CC_BINARY
62+
CC_COMMAND=$CC_BINARY
5863
else
5964
exit_if_error "Could not find binary file $CC_BINARY"
6065
fi
6166
elif [ "$CC_USE_PYPI" == "true" ];
6267
then
63-
if ! pip install codecov-cli"$([ "$CC_VERSION" == "latest" ] && echo "" || echo "==$CC_VERSION" )"; then
68+
if ! pip install "${CC_CLI_TYPE}$([ "$CC_VERSION" == "latest" ] && echo "" || echo "==$CC_VERSION")"; then
6469
exit_if_error "Could not install via pypi."
6570
exit
6671
fi
67-
c_command="codecovcli"
72+
CC_COMMAND="${CC_CLI_TYPE}"
6873
else
6974
if [ -n "$CC_OS" ];
7075
then
@@ -80,17 +85,17 @@ else
8085
[[ $(arch) == "aarch64" && $family == "linux" ]] && CC_OS+="-arm64"
8186
say "$g==>$x Detected $b${CC_OS}$x"
8287
fi
83-
c_filename="codecov"
84-
[[ $CC_OS == "windows" ]] && c_filename+=".exe"
85-
c_command="./$c_filename"
88+
CC_FILENAME="${CC_CLI_TYPE%-cli}"
89+
[[ $CC_OS == "windows" ]] && CC_FILENAME+=".exe"
90+
CC_COMMAND="./$CC_FILENAME"
8691
[[ $CC_OS == "macos" ]] && \
8792
! command -v gpg 2>&1 >/dev/null && \
8893
HOMEBREW_NO_AUTO_UPDATE=1 brew install gpg
89-
c_url="${CC_CLI_URL:-https://cli.codecov.io}"
90-
c_url="$c_url/${CC_VERSION}"
91-
c_url="$c_url/${CC_OS}/${c_filename}"
92-
say "$g ->$x Downloading $b${c_url}$x"
93-
curl -O $retry "$c_url"
94+
CC_URL="${CC_CLI_URL:-https://cli.codecov.io}"
95+
CC_URL="$CC_URL/${CC_VERSION}"
96+
CC_URL="$CC_URL/${CC_OS}/${CC_FILENAME}"
97+
say "$g ->$x Downloading $b${CC_URL}$x"
98+
curl -O $retry "$CC_URL"
9499
say "$g==>$x Finishing downloading $b${CC_OS}:${CC_VERSION}$x"
95100
v_url="https://cli.codecov.io/api/${CC_OS}/${CC_VERSION}"
96101
v=$(curl $retry --retry-all-errors -s "$v_url" -H "Accept:application/json" | tr \{ '\n' | tr , '\n' | tr \} '\n' | grep "\"version\"" | awk -F'"' '{print $4}' | tail -1)
@@ -100,161 +105,165 @@ fi
100105
if [ "$CC_SKIP_VALIDATION" == "true" ] || [ -n "$CC_BINARY" ] || [ "$CC_USE_PYPI" == "true" ];
101106
then
102107
say "$r==>$x Bypassing validation..."
108+
if [ "$CC_SKIP_VALIDATION" == "true" ];
109+
then
110+
chmod +x "$CC_COMMAND"
111+
fi
103112
else
104-
CC_PUBLIC_PGP_KEY=$(curl -s https://keybase.io/codecovsecurity/pgp_keys.asc)
105-
echo "${CC_PUBLIC_PGP_KEY}" | \
113+
echo "$(curl -s https://keybase.io/codecovsecurity/pgp_keys.asc)" | \
106114
gpg --no-default-keyring --import
107115
# One-time step
108116
say "$g==>$x Verifying GPG signature integrity"
109117
sha_url="https://cli.codecov.io"
110118
sha_url="${sha_url}/${CC_VERSION}/${CC_OS}"
111-
sha_url="${sha_url}/${c_filename}.SHA256SUM"
119+
sha_url="${sha_url}/${CC_FILENAME}.SHA256SUM"
112120
say "$g ->$x Downloading $b${sha_url}$x"
113121
say "$g ->$x Downloading $b${sha_url}.sig$x"
114122
say " "
115123
curl -Os $retry --connect-timeout 2 "$sha_url"
116124
curl -Os $retry --connect-timeout 2 "${sha_url}.sig"
117-
if ! gpg --verify "${c_filename}.SHA256SUM.sig" "${c_filename}.SHA256SUM";
125+
if ! gpg --verify "${CC_FILENAME}.SHA256SUM.sig" "${CC_FILENAME}.SHA256SUM";
118126
then
119127
exit_if_error "Could not verify signature. Please contact Codecov if problem continues"
120128
fi
121-
if ! (shasum -a 256 -c "${c_filename}.SHA256SUM" 2>/dev/null || \
122-
sha256sum -c "${c_filename}.SHA256SUM");
129+
if ! (shasum -a 256 -c "${CC_FILENAME}.SHA256SUM" 2>/dev/null || \
130+
sha256sum -c "${CC_FILENAME}.SHA256SUM");
123131
then
124132
exit_if_error "Could not verify SHASUM. Please contact Codecov if problem continues"
125133
fi
126134
say "$g==>$x CLI integrity verified"
127135
say
128-
chmod +x "$c_command"
136+
chmod +x "$CC_COMMAND"
129137
fi
130138
if [ -n "$CC_BINARY_LOCATION" ];
131139
then
132-
mkdir -p "$CC_BINARY_LOCATION" && mv "$c_filename" $_
133-
say "$g==>$x Codecov binary moved to ${CC_BINARY_LOCATION}"
140+
mkdir -p "$CC_BINARY_LOCATION" && mv "$CC_FILENAME" $_
141+
say "$g==>$x ${CC_CLI_TYPE} binary moved to ${CC_BINARY_LOCATION}"
134142
fi
135143
if [ "$CC_DOWNLOAD_ONLY" = "true" ];
136144
then
137-
say "$g==>$x Codecov download only called. Exiting..."
145+
say "$g==>$x ${CC_CLI_TYPE} download only called. Exiting..."
146+
exit
138147
fi
139-
c_cli_args=()
140-
c_cli_args+=( $(k_arg AUTO_LOAD_PARAMS_FROM) $(v_arg AUTO_LOAD_PARAMS_FROM))
141-
c_cli_args+=( $(k_arg ENTERPRISE_URL) $(v_arg ENTERPRISE_URL))
148+
CC_CLI_ARGS=()
149+
CC_CLI_ARGS+=( $(k_arg AUTO_LOAD_PARAMS_FROM) $(v_arg AUTO_LOAD_PARAMS_FROM))
150+
CC_CLI_ARGS+=( $(k_arg ENTERPRISE_URL) $(v_arg ENTERPRISE_URL))
142151
if [ -n "$CC_YML_PATH" ]
143152
then
144-
c_cli_args+=( "--codecov-yml-path" )
145-
c_cli_args+=( "$CC_YML_PATH" )
146-
fi
147-
c_cli_args+=( $(write_bool_args CC_DISABLE_TELEM) )
148-
c_cli_args+=( $(write_bool_args CC_VERBOSE) )
149-
if [ -n "$CC_TOKEN_VAR" ];
150-
then
151-
token="$(eval echo \$$CC_TOKEN_VAR)"
152-
else
153-
token="$(eval echo $CC_TOKEN)"
154-
fi
155-
say "$g ->$x Token length: ${#token}"
156-
token_str=""
157-
token_arg=()
158-
if [ -n "$token" ];
159-
then
160-
token_str+=" -t <redacted>"
161-
token_arg+=( " -t " "$token")
153+
CC_CLI_ARGS+=( "--codecov-yml-path" )
154+
CC_CLI_ARGS+=( "$CC_YML_PATH" )
162155
fi
163-
c_args=()
156+
CC_CLI_ARGS+=( $(write_bool_args CC_DISABLE_TELEM) )
157+
CC_CLI_ARGS+=( $(write_bool_args CC_VERBOSE) )
158+
CC_ARGS=()
164159
if [ "$CC_RUN_CMD" == "upload-coverage" ]; then
165160
# Args for create commit
166-
c_args+=( $(write_bool_args CC_FAIL_ON_ERROR) )
167-
c_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
168-
c_args+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
169-
c_args+=( $(k_arg PR) $(v_arg PR))
170-
c_args+=( $(k_arg SHA) $(v_arg SHA))
171-
c_args+=( $(k_arg SLUG) $(v_arg SLUG))
161+
CC_ARGS+=( $(write_bool_args CC_FAIL_ON_ERROR) )
162+
CC_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
163+
CC_ARGS+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
164+
CC_ARGS+=( $(k_arg PR) $(v_arg PR))
165+
CC_ARGS+=( $(k_arg SHA) $(v_arg SHA))
166+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
172167
# Args for create report
173-
c_args+=( $(k_arg CODE) $(v_arg CODE))
168+
CC_ARGS+=( $(k_arg CODE) $(v_arg CODE))
174169
# Args for do upload
175-
c_args+=( $(k_arg ENV) $(v_arg ENV))
170+
CC_ARGS+=( $(k_arg ENV) $(v_arg ENV))
176171
OLDIFS=$IFS;IFS=,
177-
c_args+=( $(k_arg BRANCH) $(v_arg BRANCH))
178-
c_args+=( $(k_arg BUILD) $(v_arg BUILD))
179-
c_args+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL))
180-
c_args+=( $(k_arg DIR) $(v_arg DIR))
181-
c_args+=( $(write_bool_args CC_DISABLE_FILE_FIXES) )
182-
c_args+=( $(write_bool_args CC_DISABLE_SEARCH) )
183-
c_args+=( $(write_bool_args CC_DRY_RUN) )
172+
CC_ARGS+=( $(k_arg BRANCH) $(v_arg BRANCH))
173+
CC_ARGS+=( $(k_arg BUILD) $(v_arg BUILD))
174+
CC_ARGS+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL))
175+
CC_ARGS+=( $(k_arg DIR) $(v_arg DIR))
176+
CC_ARGS+=( $(write_bool_args CC_DISABLE_FILE_FIXES) )
177+
CC_ARGS+=( $(write_bool_args CC_DISABLE_SEARCH) )
178+
CC_ARGS+=( $(write_bool_args CC_DRY_RUN) )
184179
if [ -n "$CC_EXCLUDES" ];
185180
then
186181
for directory in $CC_EXCLUDES; do
187-
c_args+=( "--exclude" "$directory" )
182+
CC_ARGS+=( "--exclude" "$directory" )
188183
done
189184
fi
190185
if [ -n "$CC_FILES" ];
191186
then
192187
for file in $CC_FILES; do
193-
c_args+=( "--file" "$file" )
188+
CC_ARGS+=( "--file" "$file" )
194189
done
195190
fi
196191
if [ -n "$CC_FLAGS" ];
197192
then
198193
for flag in $CC_FLAGS; do
199-
c_args+=( "--flag" "$flag" )
194+
CC_ARGS+=( "--flag" "$flag" )
200195
done
201196
fi
202-
c_args+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS))
203-
c_args+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE))
204-
c_args+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE))
205-
c_args+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE))
206-
c_args+=( $(write_bool_args CC_HANDLE_NO_REPORTS_FOUND) )
207-
c_args+=( $(write_bool_args CC_RECURSE_SUBMODULES) )
208-
c_args+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE))
209-
c_args+=( $(write_bool_args CC_LEGACY) )
197+
CC_ARGS+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS))
198+
CC_ARGS+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE))
199+
CC_ARGS+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE))
200+
CC_ARGS+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE))
201+
CC_ARGS+=( $(write_bool_args CC_HANDLE_NO_REPORTS_FOUND) )
202+
CC_ARGS+=( $(write_bool_args CC_RECURSE_SUBMODULES) )
203+
CC_ARGS+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE))
204+
CC_ARGS+=( $(write_bool_args CC_LEGACY) )
210205
if [ -n "$CC_NAME" ];
211206
then
212-
c_args+=( "--name" "$CC_NAME" )
207+
CC_ARGS+=( "--name" "$CC_NAME" )
213208
fi
214-
c_args+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER))
215-
c_args+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX))
216-
c_args+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER))
209+
CC_ARGS+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER))
210+
CC_ARGS+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX))
211+
CC_ARGS+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER))
217212
if [ -n "$CC_PLUGINS" ];
218213
then
219214
for plugin in $CC_PLUGINS; do
220-
c_args+=( "--plugin" "$plugin" )
215+
CC_ARGS+=( "--plugin" "$plugin" )
221216
done
222217
fi
223-
c_args+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE))
224-
c_args+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT))
218+
CC_ARGS+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE))
219+
CC_ARGS+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT))
225220
IFS=$OLDIFS
226221
elif [ "$CC_RUN_CMD" == "empty-upload" ]; then
227-
c_args+=( $(k_arg BRANCH) $(v_arg BRANCH))
228-
c_args+=( $(write_bool_args CC_FAIL_ON_ERROR) )
229-
c_args+=( $(write_bool_args CC_FORCE) )
230-
c_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
231-
c_args+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
232-
c_args+=( $(k_arg PR) $(v_arg PR))
233-
c_args+=( $(k_arg SHA) $(v_arg SHA))
234-
c_args+=( $(k_arg SLUG) $(v_arg SLUG))
222+
CC_ARGS+=( $(k_arg BRANCH) $(v_arg BRANCH))
223+
CC_ARGS+=( $(write_bool_args CC_FAIL_ON_ERROR) )
224+
CC_ARGS+=( $(write_bool_args CC_FORCE) )
225+
CC_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
226+
CC_ARGS+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
227+
CC_ARGS+=( $(k_arg PR) $(v_arg PR))
228+
CC_ARGS+=( $(k_arg SHA) $(v_arg SHA))
229+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
235230
elif [ "$CC_RUN_CMD" == "pr-base-picking" ]; then
236-
c_args+=( $(k_arg BASE_SHA) $(v_arg BASE_SHA))
237-
c_args+=( $(k_arg PR) $(v_arg PR))
238-
c_args+=( $(k_arg SLUG) $(v_arg SLUG))
239-
c_args+=( $(k_arg SERVICE) $(v_arg SERVICE))
231+
CC_ARGS+=( $(k_arg BASE_SHA) $(v_arg BASE_SHA))
232+
CC_ARGS+=( $(k_arg PR) $(v_arg PR))
233+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
234+
CC_ARGS+=( $(k_arg SERVICE) $(v_arg SERVICE))
240235
elif [ "$CC_RUN_CMD" == "send-notifications" ]; then
241-
c_args+=( $(k_arg SHA) $(v_arg SHA))
242-
c_args+=( $(write_bool_args CC_FAIL_ON_ERROR) )
243-
c_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
244-
c_args+=( $(k_arg SLUG) $(v_arg SLUG))
236+
CC_ARGS+=( $(k_arg SHA) $(v_arg SHA))
237+
CC_ARGS+=( $(write_bool_args CC_FAIL_ON_ERROR) )
238+
CC_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
239+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
245240
else
246241
exit_if_error "Invalid run command specified: $CC_RUN_CMD"
247242
exit
248243
fi
249244
unset NODE_OPTIONS
250245
# github.com/codecov/uploader/issues/475
246+
if [ -n "$CC_TOKEN_VAR" ];
247+
then
248+
token="$(eval echo \$$CC_TOKEN_VAR)"
249+
else
250+
token="$(eval echo $CC_TOKEN)"
251+
fi
252+
say "$g ->$x Token length: ${#token}"
253+
token_str=""
254+
token_arg=()
255+
if [ -n "$token" ];
256+
then
257+
token_str+=" -t <redacted>"
258+
token_arg+=( " -t " "$token")
259+
fi
251260
say "$g==>$x Running $CC_RUN_CMD"
252-
say " $b$c_command $(echo "${c_cli_args[@]}") $CC_RUN_CMD$token_str $(echo "${c_args[@]}")$x"
253-
if ! $c_command \
254-
${c_cli_args[*]} \
261+
say " $b$CC_COMMAND $(echo "${CC_CLI_ARGS[@]}") $CC_RUN_CMD$token_str $(echo "${CC_ARGS[@]}")$x"
262+
if ! $CC_COMMAND \
263+
${CC_CLI_ARGS[*]} \
255264
${CC_RUN_CMD} \
256265
${token_arg[*]} \
257-
"${c_args[@]}";
266+
"${CC_ARGS[@]}";
258267
then
259268
exit_if_error "Failed to run $CC_RUN_CMD"
260269
fi

src/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.4.3
1+
5.5.0

0 commit comments

Comments
 (0)