CI/CD #718
This file contains hidden or 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: CI/CD | |
on: | |
push: | |
branches: [main] | |
paths: [.github/workflows/ci-cd.yml] | |
workflow_dispatch: | |
schedule: | |
- cron: '30 09 * * *' | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
jobs: | |
clean-actions-runs: | |
name: Clean stale workflow runs | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- workflow: CI/CD | |
- workflow: WinGet Automation | |
- workflow: Dependabot Updates | |
steps: | |
- name: 🧹 Cleanup 🫧🪥🧼🧽 | |
run: | | |
$ErrorActionPreference = 'SilentlyContinue' | |
gh run list --workflow '${{ matrix.workflow }}' --limit 100 --status completed --json databaseId ` | |
--repo vedantmgoyal9/vedantmgoyal9 | ConvertFrom-Json | ForEach-Object { ` | |
gh run delete $_.databaseId --repo vedantmgoyal9/vedantmgoyal9 ` | |
} | |
Exit 0 # Don't fail the job if there are no runs to delete | |
shell: pwsh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }} |