MC/.forgejo/workflows/clean-ci-artifacts.yml
2026-11-27 23:43:05 +00:00

37 lines
1.1 KiB
YAML

name: "🗑️ Clean old CI artifacts"
on:
workflow_dispatch:
inputs:
dry_run:
description: "Preview only (untick to delete eligible artifacts)"
type: boolean
default: true
concurrency:
group: manual-ci-artifact-cleanup
cancel-in-progress: false
jobs:
cleanup:
if: github.ref == 'refs/heads/main'
runs-on: dune-ci
timeout-minutes: 5
steps:
- name: Checkout cleanup script
shell: bash
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git init .
git -c http.extraheader="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$REPO_TOKEN" | base64 -w0)" fetch --depth=1 https://www.dunerealms.com/git/unimatrix/MC.git "$GITHUB_SHA"
git checkout --detach FETCH_HEAD
- name: Install Node 22
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Preview or clean old website artifacts
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: ${{ inputs.dry_run }}
run: node website/scripts/manual-ci-cleanup.mjs