This file contains hidden or 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
| name: Run 2ms Scan and Upload to S3 | |
| on: | |
| push: | |
| jobs: | |
| scan-and-upload: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Run 2ms Scan | |
| uses: miguel-neiva01/2ms-github-action@v1.5.19 | |
| id: twoms_scan | |
| - name: Get Results Directory | |
| id: get_results_dir | |
| run: | | |
| echo "results_dir=${{ steps.twoms_scan.outputs.results_dir }}" >> $GITHUB_ENV | |
| - name: Set S3 Destination Path | |
| id: set_s3_path | |
| run: | | |
| BRANCH_NAME="${{ github.head_ref || github.ref_name }} | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| VERSION="v3.17.0" | |
| echo "destination_dir=2ms/${BRANCH_NAME}/${VERSION}/pr-${PR_NUMBER}" >> $GITHUB_ENV | |
| - name: Upload results to S3 | |
| uses: shallwefootball/s3-upload-action@master | |
| with: | |
| aws_key_id: ${{ secrets.CES_BUCKET_AWS_ACCESS_KEY }} | |
| aws_secret_access_key: ${{ secrets.CES_BUCKET_AWS_SECRET_ACCESS_KEY }} | |
| aws_bucket: "ces-results" | |
| source_dir: ${{ steps.twoms_scan.outputs.results_dir }} | |
| destination_dir: ${{ env.destination_dir }} |