mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-22 00:54:26 +08:00
ci: relax aws checksum mode for rainyun s3
This commit is contained in:
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -732,6 +732,8 @@ jobs:
|
|||||||
AWS_DEFAULT_REGION: ${{ vars.S3_REGION }}
|
AWS_DEFAULT_REGION: ${{ vars.S3_REGION }}
|
||||||
AWS_REGION: ${{ vars.S3_REGION }}
|
AWS_REGION: ${{ vars.S3_REGION }}
|
||||||
AWS_EC2_METADATA_DISABLED: "true"
|
AWS_EC2_METADATA_DISABLED: "true"
|
||||||
|
AWS_REQUEST_CHECKSUM_CALCULATION: "WHEN_REQUIRED"
|
||||||
|
AWS_RESPONSE_CHECKSUM_VALIDATION: "WHEN_REQUIRED"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -806,6 +808,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
aws --version
|
||||||
aws --endpoint-url "$S3_ENDPOINT" --region "$S3_REGION" s3 ls "s3://$S3_BUCKET" >/dev/null
|
aws --endpoint-url "$S3_ENDPOINT" --region "$S3_REGION" s3 ls "s3://$S3_BUCKET" >/dev/null
|
||||||
echo "S3 access probe succeeded for $S3_BUCKET"
|
echo "S3 access probe succeeded for $S3_BUCKET"
|
||||||
|
|
||||||
|
|||||||
@@ -80,11 +80,36 @@ function Invoke-AwsSyncIfPossible {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($IgnoreFailure) {
|
$previousRequestChecksumCalculation = $env:AWS_REQUEST_CHECKSUM_CALCULATION
|
||||||
& aws @Arguments 2>$null
|
$previousResponseChecksumValidation = $env:AWS_RESPONSE_CHECKSUM_VALIDATION
|
||||||
|
|
||||||
|
# Rainyun's S3-compatible endpoint rejects AWS CLI v2's default checksum headers
|
||||||
|
# during multipart uploads. Restrict checksum behavior to API-required cases only.
|
||||||
|
$env:AWS_REQUEST_CHECKSUM_CALCULATION = "WHEN_REQUIRED"
|
||||||
|
$env:AWS_RESPONSE_CHECKSUM_VALIDATION = "WHEN_REQUIRED"
|
||||||
|
|
||||||
|
try {
|
||||||
|
if ($IgnoreFailure) {
|
||||||
|
& aws @Arguments 2>$null
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
& aws @Arguments
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
finally {
|
||||||
& aws @Arguments
|
if ($null -eq $previousRequestChecksumCalculation) {
|
||||||
|
Remove-Item Env:AWS_REQUEST_CHECKSUM_CALCULATION -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$env:AWS_REQUEST_CHECKSUM_CALCULATION = $previousRequestChecksumCalculation
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($null -eq $previousResponseChecksumValidation) {
|
||||||
|
Remove-Item Env:AWS_RESPONSE_CHECKSUM_VALIDATION -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$env:AWS_RESPONSE_CHECKSUM_VALIDATION = $previousResponseChecksumValidation
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0 -and -not $IgnoreFailure) {
|
if ($LASTEXITCODE -ne 0 -and -not $IgnoreFailure) {
|
||||||
|
|||||||
Reference in New Issue
Block a user