From 1d93e23ac16ff38f1496b03d07e1ba89bb48ee1d Mon Sep 17 00:00:00 2001 From: Chad Myers Date: Fri, 16 Oct 2026 09:21:25 -0500 Subject: [PATCH] Upload build artifacts write-once to jenkins-artifacts Upload with aws s3 cp --no-overwrite and fail the step if the version folder already exists. The GitHub Actions role will require If-None-Match on jenkins-artifacts uploads. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01YEpbb7PWaTRuHJfSwZyDV1 --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b105ba4..350ab10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,4 +135,11 @@ jobs: - name: Upload Certbot Lambda Assets to S3 working-directory: certbot run: | - aws s3 cp . s3://jenkins-artifacts.us-west-2.dovetailnow.com/jobs/certbot-lambda/$NEXT_VERSION_NO_PREFIX --recursive --exclude "*" --include "*.zip" + set -euo pipefail + DEST="s3://jenkins-artifacts.us-west-2.dovetailnow.com/jobs/certbot-lambda/$NEXT_VERSION_NO_PREFIX" + # --no-overwrite skips an existing key with no error, so fail here first. + if aws s3 ls "$DEST/" > /dev/null; then + echo "::error::$DEST/ already exists" + exit 1 + fi + aws s3 cp . "$DEST" --recursive --exclude "*" --include "*.zip" --no-overwrite