-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the new workflows available on main, so that we can see them in …
…the list and test them on the feature branch...
- Loading branch information
LanDinh
committed
Jan 23, 2023
1 parent
f33aed1
commit 3974d43
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Clean Cache | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
commit: | ||
description: the commit for which to | ||
required: true | ||
type: string | ||
jobs: | ||
# Delete workflow runs inside the workflow to clean it up. | ||
clean-cache: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Clean up cache. | ||
uses: ./.github/actions/clean-cache |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Delete Old Workflow Runs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
workflow: | ||
description: the workflow that needs to be deleted | ||
required: true | ||
type: string | ||
jobs: | ||
# Delete workflow runs inside the workflow to clean it up. | ||
delete-workflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Clean up old workflow data. | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
console.log('Start deletion of workflow runs.') | ||
const workflow_runs = await github.rest.actions.listWorkflowRuns({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
workflow_id: '${{ inputs.workflow }}', | ||
}) | ||
for (const workflow_run of workflow_runs.data.workflow_runs) { | ||
console.log(workflow_run) | ||
github.rest.actions.deleteWorkflowRun({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: workflow_run.id, | ||
}) | ||
} | ||
console.log('Finished deletion of workflow runs.') |