question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CleanUp GitHub Actions

See original GitHub issue

Our Github actions are a mess, we started and improved them over time, we renamed them etc. But now we do have some old Actions in there, which we do not need anymore. Sadly there is no GUI way of deleting them, but we can delete them via api.

We should delete all GitHub Actions which are deactivated:

within this GitHub support question answer, we do have all the script paths we need. The executor needs to have jq and gh installed.

  1. Fetching the workflow IDs with
OWNER=<your user/org name>
REPO=<repo name>

# list workflows
gh api -X GET /repos/$OWNER/$REPO/actions/workflows | jq '.workflows[] | .name,.id'
  1. Deleting all workflow runs with

OWNER=<your user/org name>
REPO=<repo name>
# copy the ID of the workflow you want to clear and set it
WORKFLOW_ID=<workflow id>

# list runs
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs | jq '.workflow_runs[] | .id'

# delete all runs
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs | jq '.workflow_runs[] | .id' | xargs -I{} gh api -X DELETE /repos/$OWNER/$REPO/actions/runs/{}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
nipafxcommented, Jul 6, 2021

This comment made me think that, if #502 decides to pull in optional dependencies, modular builds should be part of the basic builds.

1reaction
nipafxcommented, Jul 27, 2021

@aepfli I’ve cleaned out two of them manually but have capitulated for the third, which must have hundreds and hundreds of builds. Can you delete them automatically? 🥺

Read more comments on GitHub >

github_iconTop Results From Across the Web

Marketplace Actions Workflow run cleanup action - GitHub
This action cleans up previously running instances of a workflow on the same branch. This accomplishes the task of automatically cancelling CI runs...
Read more >
How to actually clean up the repository on self-hosted runner ...
git folder, and then actions/checkout@v2 will clone the repository properly, just like when running on github runners. -H. Share.
Read more >
Cleanup legacy GitHub Actions workflow runs. - Popular Blocks
Python utility to delete in bulk all GitHub Actions runs for a given workflow, either current or legacy/since removed. The GitHub UI currently...
Read more >
GitHub Actions integration - Werf
... cleanup — the job to clean up the stages storage and the Docker registry. Jobs are based on comprehensive GitHub Actions, werf/actions,...
Read more >
Github Action - Clean up resources - DEV Community ‍ ‍
Github Action - Clean up resources · Check out git repo. · Build project. · Deploy to a Demo environment. · Clean up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found