Delete PR s3 when PR closed (#262)

Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/blog/pulls/262
Reviewed-by: delvh <dev.lh@web.de>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Lunny Xiao 2023-04-20 22:48:27 +08:00 committed by techknowlogick
parent 878dcfaeb8
commit d0a6708d0a
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
name: delete closed PR preview s3
on:
pull_request:
types: [closed]
env:
AWS_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
delete_preview:
runs-on: ubuntu-latest
steps:
- name: install aws cli
run: apt update -y && apt install -y awscli
- name: delete bucket
run: aws s3 rb s3://preview-gitea-org-${{ github.event.repository.name }}-${{ github.event.number }} --force || /bin/true