Skip to content

Commit

Permalink
ci: support workflow_dispatch of Cleanup workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Feb 10, 2025
1 parent 2976b64 commit 42b6502
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: "Cleanup"
on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
branch:
description: 'Name of the Git branch'
required: true
default: 'main'

jobs:
clean-cache:
Expand All @@ -12,24 +18,24 @@ jobs:
- uses: actions/checkout@v4.2.2
- name: "Run gh-cleanup-cache.ps1"
run: |
./scripts/gh-cleanup-cache.ps1 `
-Branch ${{ github.event.pull_request.head.ref }}
$branch = "${{ github.event.pull_request.head.ref || github.event.inputs.branch }}"
./scripts/gh-cleanup-cache.ps1 -Branch "$branch"
shell: pwsh

clean-runs:
name: "Cleanup Workflow Runs"
name: "Cleanup Runs"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4.2.2
- name: "Run gh-cleanup-runs.ps1"
run: |
./scripts/gh-cleanup-runs.ps1 `
$branch = "${{ github.event.pull_request.head.ref || github.event.inputs.branch }}"
./scripts/gh-cleanup-runs.ps1 -Branch "$branch" `
-Workflow "build.yml" `
-Branch ${{ github.event.pull_request.head.ref }}
shell: pwsh
- name: "Run gh-cleanup-runs.ps1"
run: |
./scripts/gh-cleanup-runs.ps1 `
$branch = "${{ github.event.pull_request.head.ref || github.event.inputs.branch }}"
./scripts/gh-cleanup-runs.ps1 -Branch "$branch" `
-Workflow "build-windows-hosted.yml" `
-Branch ${{ github.event.pull_request.head.ref }}
shell: pwsh

0 comments on commit 42b6502

Please sign in to comment.