File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,9 @@ be uploaded to the product's S3 bucket:
167
167
` ` `
168
168
169
169
Optionally, you can specify which files to upload using the `filenames` input.
170
- By default, all files in the S3 directory are uploaded.
170
+ By default, all files in the S3 directory are uploaded. When the `dry_run` input
171
+ is set to anything other than `false`, no files are uploaded, but instead the
172
+ filename along with the resulting location in the bucket is printed.
171
173
172
174
# # Python Helper Scripts
173
175
Original file line number Diff line number Diff line change @@ -8,14 +8,22 @@ inputs:
8
8
description : " The name of the product"
9
9
required : true
10
10
filenames :
11
- description : Files to upload - supports wildcards and glob patterns
11
+ description : " Files to upload - supports wildcards and glob patterns"
12
12
default : ' *'
13
13
required : false
14
+ dry_run :
15
+ description : " Only print files that would be uploaded, but don't upload any files"
16
+ required : false
17
+ default : ' false'
14
18
15
19
runs :
16
20
using : composite
17
21
steps :
18
22
- shell : bash
19
23
working-directory : ${{ env.S3_ASSETS }}
20
24
run : |
21
- for filename in ${{ inputs.filenames }}; do aws s3 cp ${filename} s3://${AWS_BUCKET}/${{ inputs.product_name }}/${{ inputs.version }}/${filename}; done
25
+ if [ "${{ inputs.dry_run }}" == "false" ]; then
26
+ for filename in ${{ inputs.filenames }}; do aws s3 cp ${filename} s3://${AWS_BUCKET}/${{ inputs.product_name }}/${{ inputs.version }}/${filename}; done
27
+ else
28
+ for filename in ${{ inputs.filenames }}; do echo "Would upload ${filename} to ${{ inputs.product_name }}/${{ inputs.version }}/${filename}"; done
29
+ fi
You can’t perform that action at this time.
0 commit comments