Skip to content

Delete feature branch from S3 #1189

Delete feature branch from S3

Delete feature branch from S3 #1189

name: Delete feature branch from S3
on: delete
jobs:
cleanup:
runs-on: ubuntu-latest
if: github.event.ref_type == 'branch' && startsWith(github.event.ref, 'feature-') == true
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: Remove from S3
uses: vitorsgomes/s3-rm-action@master
with:
args: --recursive
env:
# Update this according to the name of your S3 bucket.
AWS_S3_BUCKET: uk-sdg-feature-branches
# Don't forget to set AWS_ACCESS as a "repository secret".
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS }}
# Don't forget to set AWS_SECRET as a "repository secret".
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET }}
PATH_TO_DELETE: ${{ env.GITHUB_EVENT_REF_SLUG }}