Cleanup Old Artifacts #3
Workflow file for this run
This file contains 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: Cleanup Old Artifacts | |
on: | |
workflow_dispatch: | |
inputs: | |
days_to_keep: | |
description: "Number of days to keep artifacts" | |
required: true | |
default: 30 | |
type: number | |
schedule: | |
- cron: '0 0 */15 * *' # Runs every 15 days at midnight UTC | |
permissions: | |
contents: read | |
actions: write | |
jobs: | |
cleanup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Run Artifact Cleanup | |
env: | |
GH_TOKEN: ${{ secrets.REPO_TOKEN }} | |
REPO_OWNER: ${{ github.repository_owner }} | |
REPO_NAME: ${{ github.repository }} | |
DAYS_TO_KEEP: ${{ github.event.inputs.days_to_keep || '15' }} | |
run: |- | |
make cleanup_artifacts \ | |
REPO_OWNER="${REPO_OWNER}" \ | |
REPO_NAME="${REPO_NAME}" \ | |
DAYS_TO_KEEP="${DAYS_TO_KEEP}" |