forked from awslabs/mountpoint-s3-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.42 KB
/
Copy pathcleanup-old-buckets.yaml
File metadata and controls
48 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Cleanup Old Test Buckets
on:
schedule:
# Run every Wednesday at 6:00 AM UTC (cron: minute hour day-of-month month day-of-week)
- cron: '0 6 * * 3'
workflow_dispatch:
inputs:
days_old:
description: Number of days old for buckets to be deleted
required: false
default: 7
type: number
jobs:
cleanup-old-buckets:
runs-on: ubuntu-latest
# this is to prevent the job to run at forked projects
if: ${{ ! github.repository.fork }}
strategy:
matrix:
environment: [trusted, untrusted, rosa-trusted, rosa-untrusted]
environment: ${{ matrix.environment }}
permissions:
id-token: write # Required for OIDC authentication with AWS
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ vars.IAM_ROLE }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 3600 # 1 hour should be sufficient for cleanup
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Delete Old Test Buckets
env:
AWS_REGION: ${{ vars.AWS_REGION }}
run: |
tests/e2e-kubernetes/scripts/bucket-cleanup.py cleanup \
--days-old ${{ github.event.inputs.days_old || '7' }}