Given the following github action:
<code>name: MyPipeline
on:
workflow_dispatch:
permissions:
# Required for release
contents: write
jobs:
build:
runs-on: windows-latest
outputs:
artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
steps:
# Other steps ommitted
- name: Upload Artifact
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: MyArtifact
path: ./output/
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
steps:
# Use API because download artifact action will unzip the artifact, but we want to keep it zipped
- name: Download artifact using curl
run: >
curl -L --no-progress-meter --fail-with-body
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
-H "X-GitHub-Api-Version: 2022-11-28"
-O "./output/MyArtifact.zip
"${{ needs.build.outputs.artifact-url }}"
shell: bash
</code>
<code>name: MyPipeline
on:
workflow_dispatch:
permissions:
# Required for release
contents: write
jobs:
build:
runs-on: windows-latest
outputs:
artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
steps:
# Other steps ommitted
- name: Upload Artifact
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: MyArtifact
path: ./output/
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
steps:
# Use API because download artifact action will unzip the artifact, but we want to keep it zipped
- name: Download artifact using curl
run: >
curl -L --no-progress-meter --fail-with-body
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
-H "X-GitHub-Api-Version: 2022-11-28"
-O "./output/MyArtifact.zip
"${{ needs.build.outputs.artifact-url }}"
shell: bash
</code>
name: MyPipeline
on:
workflow_dispatch:
permissions:
# Required for release
contents: write
jobs:
build:
runs-on: windows-latest
outputs:
artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
steps:
# Other steps ommitted
- name: Upload Artifact
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: MyArtifact
path: ./output/
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
steps:
# Use API because download artifact action will unzip the artifact, but we want to keep it zipped
- name: Download artifact using curl
run: >
curl -L --no-progress-meter --fail-with-body
-H "Accept: application/vnd.github+json"
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
-H "X-GitHub-Api-Version: 2022-11-28"
-O "./output/MyArtifact.zip
"${{ needs.build.outputs.artifact-url }}"
shell: bash
Curl gives the error:
Could not resolve host: .
If I echo ${{ steps.artifact-upload-step.outputs.artifact-url }}
in the publish job, I see my correct artifact URL. (And can download it via browser)
I read through this issue: https://github.com/actions/upload-artifact/issues/89
And tried appending /zip
, but still doesn’t work.
Step output:
<code>Run curl -L --no-progress-meter --fail-with-body -H "Accept: application/vnd.github+json" -H "Authorization: ***" -H "X-GitHub-Api-Version: 2022-11-28" -O "./output/MyArtifact.zip" "https://github.com/MyOrg/MyRepo/actions/runs/10293145930/artifacts/1788063174"
curl -L --no-progress-meter --fail-with-body -H "Accept: application/vnd.github+json" -H "Authorization: ***" -H "X-GitHub-Api-Version: 2022-11-28" -O "./output/MyArtifact.zip" "https://github.com/MyOrg/MyRepo/actions/runs/10293145930/artifacts/1788063174"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
VERSION: 1.0.0.12
DOTNET_ROOT: /usr/share/dotnet
curl: (6) Could not resolve host: .
curl: (22) The requested URL returned error: 404
Not Found
</code>
<code>Run curl -L --no-progress-meter --fail-with-body -H "Accept: application/vnd.github+json" -H "Authorization: ***" -H "X-GitHub-Api-Version: 2022-11-28" -O "./output/MyArtifact.zip" "https://github.com/MyOrg/MyRepo/actions/runs/10293145930/artifacts/1788063174"
curl -L --no-progress-meter --fail-with-body -H "Accept: application/vnd.github+json" -H "Authorization: ***" -H "X-GitHub-Api-Version: 2022-11-28" -O "./output/MyArtifact.zip" "https://github.com/MyOrg/MyRepo/actions/runs/10293145930/artifacts/1788063174"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
VERSION: 1.0.0.12
DOTNET_ROOT: /usr/share/dotnet
curl: (6) Could not resolve host: .
curl: (22) The requested URL returned error: 404
Not Found
</code>
Run curl -L --no-progress-meter --fail-with-body -H "Accept: application/vnd.github+json" -H "Authorization: ***" -H "X-GitHub-Api-Version: 2022-11-28" -O "./output/MyArtifact.zip" "https://github.com/MyOrg/MyRepo/actions/runs/10293145930/artifacts/1788063174"
curl -L --no-progress-meter --fail-with-body -H "Accept: application/vnd.github+json" -H "Authorization: ***" -H "X-GitHub-Api-Version: 2022-11-28" -O "./output/MyArtifact.zip" "https://github.com/MyOrg/MyRepo/actions/runs/10293145930/artifacts/1788063174"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
VERSION: 1.0.0.12
DOTNET_ROOT: /usr/share/dotnet
curl: (6) Could not resolve host: .
curl: (22) The requested URL returned error: 404
Not Found