* [StepSecurity] ci: Harden GitHub Actions Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> * imprement coderabbit recommendations --------- Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> Co-authored-by: Igor Velkov <325961+iav@users.noreply.github.com>
31 lines
757 B
YAML
31 lines
757 B
YAML
name: "Maintenance: Clean workflow logs"
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * 1" # Runs "At 00:00 on Monday." (see https://crontab.guru)
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
runs_older_than:
|
|
description: "The amount of days old to delete"
|
|
default: "10"
|
|
required: false
|
|
|
|
env:
|
|
SCHEDULED_RUNS_OLDER_THAN: "10"
|
|
SCHEDULED_RUNS_TO_KEEP: "0"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
clean-logs:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: write
|
|
steps:
|
|
- uses: igorjs/gh-actions-clean-workflow@v7
|
|
with:
|
|
runs_older_than: ${{ github.event.inputs.runs_older_than || env.SCHEDULED_RUNS_OLDER_THAN }}
|
|
runs_to_keep: ${{ github.event.inputs.runs_to_keep || env.SCHEDULED_RUNS_TO_KEEP }}
|