-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: prevent s3 files being overwritten
If a released binary has been uploaded to S3, it should be prevented from being overwritten. If it is being overwritten, it could very well be suggestive of a mistake somewhere. If you really want to intentionally overwrite the file for some reason, remove it from the S3 bucket manually, then run the workflow again.
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
BUCKET_NAME="your-bucket-name" | ||
DESTINATION_PATH="s3://nat-detection/nat-detection-0.1.0-aarch64-unknown-linux-musl.zip" | ||
LOCAL_FILE_PATH="path/to/local/file" | ||
|
||
if aws s3 ls "$DESTINATION_PATH" > /dev/null 2>&1; then | ||
echo "Error: Destination file already exists in the bucket." | ||
exit 1 | ||
else | ||
echo "will upload" | ||
fi |