Skip to content

Commit

Permalink
add upload to s3 capability
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed May 30, 2024
1 parent 3a962aa commit e0ad018
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/actions/publish_asset_to_s3/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

name: Publish Python
description: "Publish Assets and Report"
inputs:
version:
description: "The published version"
required: true
product_name:
description: "The name of the product"
required: true
files:
description: file to upload
required: true
dry_run:
description: "Whether this is a dry run"
required: true

runs:
using: composite
steps:
- name: Run publish script
shell: bash
run: |
set -eux
if [ "$DRY_RUN" == "false" ]; then
echo "Uploading Release Reports"
TARGET=s3://${AWS_BUCKET}/${PRODUCT_NAME}/${VERSION}
aws s3 cp $FILES $TARGET
else
echo "Dry run, not uploading to S3 or creating GitHub Release"
echo "Would upload $FILES"
fi
env:
VERSION: ${{ inputs.version }}
PRODUCT_NAME: ${{ inputs.product_name }}
DRY_RUN: ${{ inputs.dry_run }}
FILES: ${{ inputs.files }}

8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ jobs:
run: |
ls ${{ env.S3_ASSETS }}
cat ${{ env.S3_ASSETS }}/sarif-report.json
- name: actions/publish_asset_to_s3
uses: ./.github/actions/publish_asset_to_s3
with:
version: v6.5.0
product_name: js-bson-development
files: sarif-report.json
dry_run: false

0 comments on commit e0ad018

Please sign in to comment.