diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 973574ce5d..59702bc50d 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -107,9 +107,9 @@ jobs: envsubst < .github/uffizzi/docker-compose.uffizzi.yml > docker-compose.rendered.yml cat docker-compose.rendered.yml - name: Upload Rendered Compose File as Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: preview-spec + name: preview-spec-docker-compose path: docker-compose.rendered.yml retention-days: 2 - name: Serialize PR Event to File @@ -118,9 +118,9 @@ jobs: ${{ toJSON(github.event) }} EOF - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: preview-spec + name: preview-spec-event path: event.json retention-days: 2 @@ -174,8 +174,9 @@ jobs: EOF - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: preview-spec + name: preview-spec-event path: event.json retention-days: 2 + overwrite: true diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml index 437d42cc73..ce5c73a4e1 100644 --- a/.github/workflows/uffizzi-preview.yml +++ b/.github/workflows/uffizzi-preview.yml @@ -20,31 +20,14 @@ jobs: steps: - name: 'Download artifacts' # Fetch output (zip archive) from the workflow run that triggered this workflow. - uses: actions/github-script@v6 + uses: actions/download-artifact@v4 with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "preview-spec" - })[0]; - if (matchArtifact === undefined) { - throw TypeError('Build Artifact not found!'); - } - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); + path: preview-spec + pattern: preview-spec-* + merge-multiple: true - name: 'Accept event from first stage' - run: unzip preview-spec.zip event.json + run: cp preview-spec/event.json . - name: Read Event into ENV id: event @@ -58,7 +41,7 @@ jobs: # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. if: ${{ steps.event.outputs.ACTION != 'closed' }} run: | - unzip preview-spec.zip docker-compose.rendered.yml + cp preview-spec/docker-compose.rendered.yml . echo "COMPOSE_FILE_HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_OUTPUT - name: Cache Rendered Compose File