Skip to content

Commit

Permalink
Add s3 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeLonewolf committed Oct 23, 2023
1 parent f85043a commit 843f11f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/s3-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Delete S3 Files on PR Merged

on:
pull_request:
types:
- closed

jobs:
delete-s3-files:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Remove files from S3
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
aws s3 rm s3://${{ secrets.AWS_S3_BUCKET }}/pr/${PR_NUMBER}/ --recursive

0 comments on commit 843f11f

Please sign in to comment.