Skip to content

Commit

Permalink
[semver:patch] Fix issue with Windows curling the bash script (#88)
Browse files Browse the repository at this point in the history
* [semver:patch] Fix issue with Windows curling the bash script

* use native curl
  • Loading branch information
thomasrockhu authored May 26, 2021
1 parent d7ce050 commit c9b2aac
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.2
**Fixes**
- #88 Fixes issue with Windows curling the bash script

## 1.2.1
**Fixes**
- #87 Fix support for Windows executors
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# codecov-circleci-orb

## Latest version 1.2.1
## Latest version 1.2.2

[![codecov.io](https://codecov.io/github/codecov/codecov-circleci-orb/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-circleci-orb)
[![Circle CI](https://circleci.com/gh/codecov/codecov-circleci-orb.png?style=badge)](https://circleci.com/gh/codecov/codecov-circleci-orb)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codecov-circleci-orb",
"version": "1.2.1",
"version": "1.2.2",
"description": "Codecov CircleCI Orb",
"main": "index.js",
"devDependencies": {
Expand Down
11 changes: 6 additions & 5 deletions src/@orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ commands:
steps:
- run:
name: Download Codecov Bash Uploader
command: curl -Outfile codecov -Uri << parameters.url >>
command: Invoke-WebRequest -Uri "<< parameters.url >>" -Outfile codecov
when: << parameters.when >>
- when:
condition: << parameters.validate_url >>
Expand All @@ -61,10 +61,11 @@ commands:
command: |
$VERSION=((Select-String -path codecov 'VERSION=\"[0-9\.]*\"' | ForEach-Object {$_.Matches} | Foreach-Object {$_.Groups[0].Value})-split '"')[1]
foreach ($i in 1, 256, 512) {
$hash = (((curl "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM")[0])-split( " " ))[0]
echo "Pulling public hashes from https://github.com/codecov/codecov-bash/releases/download/${VERSION}/SHA${i}SUM"
$hash = (((Invoke-WebRequest -Uri "https://github.com/codecov/codecov-bash/releases/download/${VERSION}/SHA${i}SUM")[0])-split( " " ))[0]
$scripthash = (Get-FileHash -Algorithm "SHA${i}" codecov).hash.ToLower()
If ($scripthash -ne $hash) {
echo "Script hash: ${scripthash}"
echo "Script hash: ${scripthash}"
echo "Published has: ${hash}"
echo "SHASUMs do not match, exiting."
exit 1
Expand All @@ -75,7 +76,7 @@ commands:
- run:
name: Upload Coverage Results
command: |
$arguments = @( "-Q", "codecov-circleci-orb-1.2.1" )
$arguments = @( "-Q", "codecov-circleci-orb-1.2.2" )
If ( "<< parameters.token >>" -ne "") {
$arguments += "-t"
$arguments += "<< parameters.token >>"
Expand Down Expand Up @@ -125,7 +126,7 @@ commands:
[[ -n "<< parameters.file >>" ]] && args+=( '-f << parameters.file >>' )
[[ -n "<< parameters.xtra_args >>" ]] && args+=( '<< parameters.xtra_args >>' )
bash codecov \
-Q "codecov-circleci-orb-1.2.1" \
-Q "codecov-circleci-orb-1.2.2" \
-t "<< parameters.token >>" \
-n "<< parameters.upload_name >>" \
-F "<< parameters.flags >>" \
Expand Down

0 comments on commit c9b2aac

Please sign in to comment.