From a98684c0476457bafba36bf382b3d027fb828fcb Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Sat, 18 Jun 2022 21:11:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=EF=BC=9A=E5=88=A0=E9=99=A4Gi?= =?UTF-8?q?tHub=20Actions=E6=97=A7=E7=9A=84=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/Delete_Old_Workflow_Runs.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/Delete_Old_Workflow_Runs.yml diff --git a/.github/workflows/Delete_Old_Workflow_Runs.yml b/.github/workflows/Delete_Old_Workflow_Runs.yml new file mode 100644 index 00000000..0b1d48cc --- /dev/null +++ b/.github/workflows/Delete_Old_Workflow_Runs.yml @@ -0,0 +1,37 @@ +name: Delete old workflow runs +on: + workflow_dispatch: + inputs: + days: + description: 'Number of days.' + required: true + default: 30 + minimum_runs: + description: 'The minimum runs to keep for each workflow.' + required: true + default: 6 + delete_workflow_pattern: + description: 'The name or filename of the workflow. if not set then it will target all workflows.' + required: false + default: 'Nightly_Build.yml' + delete_workflow_by_state_pattern: + description: 'Remove workflow by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' + required: false + dry_run: + description: 'Only log actions, do not perform any delete operations.' + required: false + +jobs: + del_runs: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: ${{ github.event.inputs.days }} + keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} + delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} + delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} + dry_run: ${{ github.event.inputs.dry_run }} \ No newline at end of file