Clean Github Action

还你 Github Action 出厂般的干净

每次看到自己的 GitHub Action 后台一堆记录,就莫名烦躁。 这个自动删除运行记录的 Action,绝对是强迫症患者的福音。

delete-workflow-runs

name: Delete old workflow runs
on:
  schedule:
    - cron: "0 0 1 * *"
jobs:
  delete-runs:
    runs-on: ubuntu-latest
    permissions:
      actions: write
      contents: read
    steps:
      - name: Delete workflow runs
        uses: Mattraks/delete-workflow-runs@v2
        with:
          token: ${{ github.token }}
          repository: ${{ github.repository }}
          retain_days: 30
          keep_minimum_runs: 6

strumwolf/delete-deployment-environment

cleanup:
  runs-on: ubuntu-latest
  permissions: write-all
  steps:
    - name: Delete deployment
      uses: strumwolf/delete-deployment-environment@v2.3.0
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        environment: github-pages
        onlyRemoveDeployments: true