🧹 Weekly repo cleanup #90
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: Weekly repo cleanup 🔥 | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 22 * * 1" # Weekly at 22:30 UTC on Mondays | |
jobs: | |
clean-ghcr: | |
name: Delete old unused container images | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: | |
- ubuntu-focal | |
- podman | |
- rootless-ubuntu-focal | |
- ubuntu-jammy | |
steps: | |
- name: Delete untagged containers | |
uses: snok/container-retention-policy@v2 | |
with: | |
image-names: kubernoodles/${{ matrix.runner }} | |
cut-off: Two hours ago UTC | |
timestamp-to-use: created_at | |
account-type: personal | |
filter-tags: null* | |
skip-tags: latest, v* | |
token: ${{ secrets.GHCR_CLEANUP_TOKEN }} | |
stale: | |
name: Destalinate! | |
runs-on: ubuntu-latest | |
steps: | |
- name: Close stale issues and pull requests | |
uses: actions/stale@v8 | |
with: | |
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 2 weeks." | |
close-issue-message: "This issue was closed because it has been stalled for 2 weeks with no activity." | |
days-before-issue-stale: 30 | |
days-before-issue-close: 14 | |
stale-issue-label: "stale" | |
exempt-issue-labels: "epic" | |
stale-pr-message: "This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 2 weeks." | |
close-pr-message: "This PR was closed because it has been stalled for 2 weeks with no activity." | |
days-before-pr-stale: 30 | |
days-before-pr-close: 14 | |
stale-pr-label: "stale" | |
exempt-pr-labels: "dependencies" | |
clean-offline-runners: | |
name: Delete offline self-hosted runners | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete offline self-hosted runners | |
uses: some-natalie/runner-reaper@main | |
env: | |
GITHUB_PAT: ${{ secrets.RUNNER_REAPER }} |