Unverified Commit 2f979628 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[ci] Skip preview tarball upload when the artifact is missing (#98713)

The build-and-deploy workflow can conclude successfully without
producing a `preview-tarballs` artifact, for example when its
`deploy-tarball` job is skipped on docs-only canary pushes or on
production tag pushes
(https://github.com/vercel/next.js/actions/runs/35075211933). The
`upload-preview-tarballs` workflow then failed when downloading the
artifact.

This change lets the download step fail without failing the job and
skips the upload step in that case, so a missing artifact no longer
turns the workflow red. The failed-but-tolerated download step still
leaves an error annotation on the green run. Real breakage still
surfaces in build-and-test, which waits on the published tarballs.
parent 27a39ba1
......@@ -35,7 +35,13 @@ jobs:
scripts/upload-preview-tarballs.js
sparse-checkout-cone-mode: false
# build-and-deploy skips its deploy-tarball job for e.g. docs-only
# changes or production tag pushes, in which case there is no artifact
# and nothing to upload. Not an error: build-and-test waits on the
# published tarballs and would surface real breakage.
- name: Download preview-tarballs artifact
id: download
continue-on-error: true
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: preview-tarballs
......@@ -44,6 +50,7 @@ jobs:
run-id: ${{ github.event.workflow_run.id }}
- name: Upload tarballs to Vercel Blob
if: steps.download.outcome == 'success'
run: node scripts/upload-preview-tarballs.js "${{
github.event.workflow_run.head_sha }}" "${{ runner.temp
}}/preview-tarballs"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment