Is there a way to delete or hide old/renamed Workflows? #26256
-
I made a Workflow using the Node CI template and then later renamed it. Now my Workflow list has “Node CI” in it, but that doesnt even exist anymore. Is there some way for me to hide it? Or is it there forever? |
Beta Was this translation helpful? Give feedback.
Replies: 129 comments 143 replies
-
You can’t remove it yet, but it won’t be there forever. You can’t delete it yet but we’ll have functionality to delete this in the future. |
Beta Was this translation helpful? Give feedback.
-
Its been 3 months since this post? Can I delete yet? Its annoying that a typo leaves an action in the workflow |
Beta Was this translation helpful? Give feedback.
-
Hi, any updates on this issue/feature? we have several spurious workflows here: https://github.com/devitocodes/devito/actions and we’re really looking forward for some clean up … Thanks! |
Beta Was this translation helpful? Give feedback.
-
Any updates on that ? |
Beta Was this translation helpful? Give feedback.
-
I got all excited when I saw this was marked as “solved/go to solution”. Then I found the solution was to wait as it would be fixed sometime in the future! We could close all our issues right now with the same message 😉 Seriously though, while we love actions and are creating/recreating lots of them, our actions page littered with orphaned action detritus. |
Beta Was this translation helpful? Give feedback.
-
How is this solved? Any update on this? And what do you mean by won’t be there forever? They do. |
Beta Was this translation helpful? Give feedback.
-
Hi, with all due respect this doesn’t exactly “solve” the problem, is there any update or ETA on this please? Thanks |
Beta Was this translation helpful? Give feedback.
-
We really need this feature… Wanna get rid of those old experimental workflows. |
Beta Was this translation helpful? Give feedback.
-
Hi, any ETA on this? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Has anyone figured a way to clean them? |
Beta Was this translation helpful? Give feedback.
-
Also looking forward to seeing this. |
Beta Was this translation helpful? Give feedback.
-
“solved” = “won’t fix” it seems. |
Beta Was this translation helpful? Give feedback.
-
Hey Guys, i see that many have asked this me also was going to ask, but i found a work around. |
Beta Was this translation helpful? Give feedback.
-
This is not working. I deleted the workflow but still actions has all history of workflow executions. Currently there is no way to get rid of this. |
Beta Was this translation helpful? Give feedback.
-
I tried this myself, make sure you push to github repo after you delete files related to workflow. |
Beta Was this translation helpful? Give feedback.
-
You can delete old workflows by deleting all workflow runs, and that in turn you can automate using CLI: gh run list --limit 500 --workflow '<workflow name>' --json databaseId | jq -r '.[] | .databaseId | @sh' | xargs -I{} gh run delete "{}" Using the script above I was able to quickly cleanup multiple old workflows that had hundreds of runs 🙂 |
Beta Was this translation helpful? Give feedback.
-
👋 Hey everyone - I'm a PM for Actions and I'm working on a set of changes that also include how/when deleted workflows show up in the list. As some of you have already discovered, the behavior of workflows removed from the default branch will sometimes differ from those removed from non-default branches. This is creating some challenges for me but I have a few ideas in mind. I'd love to chat with 10 or so customers to learn more about your process of building new workflows and the tasks you're working on in the Actions tab. I'm particularly interested in folks that regularly build/test workflows on non-default branches but happy to chat with anyone that has feedback. If you're interested, please fill out this form and I'll reach out to setup some time. I'll close the form once I get enough conversations setup. Thank you! |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this change came out today or earlier, but looks like a lot of my old, messy workflows have disappeared from the Actions tab on the repo I manage. 🥳 This is more or less what mine looks like now: Previously there were dozens of workflows and a "see more" (or similar) link at the bottom of the list. |
Beta Was this translation helpful? Give feedback.
-
Hi @ethomson, any updates regarding this issue ? |
Beta Was this translation helpful? Give feedback.
-
Just a +1 to say I would like to see this issue resolved. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I've got a workaround. Like someone mentioned, once all runs go away the workflow goes away. So here's a way to automate removal all of the runs using gh run list --workflow=stale-workflow.yml --json databaseId | jq '.[].databaseId' | xargs -I{} gh run delete {} |
Beta Was this translation helpful? Give feedback.
-
Combining @dmitrym0 comment with the limit 500 in @maximbaz comment (because the default limit is smaller). Make sure you
|
Beta Was this translation helpful? Give feedback.
-
I have a unique issue that is related. Our repo has no workflow runs of a now renamed (added https://github.com/Botspot/pi-apps/actions/workflows/update_apps_raspbian_addons.yml running So for me there is no workaround available for getting this workflow to not show up. |
Beta Was this translation helpful? Give feedback.
-
The fact that this is a 5 year old issue is WILD 💀 |
Beta Was this translation helpful? Give feedback.
-
If you really hate seeing hang around, try bringing it back and add a dummy run (something like |
Beta Was this translation helpful? Give feedback.
-
I really want to delete old actions. |
Beta Was this translation helpful? Give feedback.
-
would love to see this |
Beta Was this translation helpful? Give feedback.
-
https://github.com/orgs/community/discussions/26256#discussioncomment-7295831 |
Beta Was this translation helpful? Give feedback.
-
I think you can do as follows. First, you create a new script, here I name it name: Remove Expired Workflow Runs
on:
schedule: [{ cron: "30 1 * * *" }] # Schedule to run the workflow every day at 1:30 AM
workflow_dispatch:
jobs:
clean:
name: Delete Expired Workflow Runs
runs-on: ubuntu-latest
steps:
- name: Checkout Action Code
uses: actions/checkout@v2
- name: Run Delete Script
# run: sh ./delete.sh (your org or github name) (your repo name)
run: sh ./delete.sh Long18 github-test-action
working-directory: .github/actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} Next, I have a new script, I name it #!/bin/bash
org="$1"
repo="$2"
echo "Deleting workflow runs for $org/$repo"
workflows_temp=$(mktemp) # Creates a temporary file to store workflow data.
gh api repos/$org/$repo/actions/workflows | jq -r '.workflows[] | [.id, .path] | @tsv' > $workflows_temp # Lookup workflow
cat "$workflows_temp"
workflows_names=$(awk '{print $2}' $workflows_temp | grep -v "main")
if [ -z "$workflows_names" ]; then
echo "All workflows are either successful or failed. Nothing to remove"
else
echo "Removing all the workflows that are not successful or failed"
for workflow_name in $workflows_names; do
workflow_filename=$(basename "$workflow_name")
echo "Deleting |$workflow_filename|, please wait..."
gh run list --limit 500 --workflow $workflow_filename --json databaseId |
jq -r '.[] | .databaseId' |
xargs -I{} gh run delete {} # Delete all workflow runs for workflow name
done
fi
rm -rf $workflows_temp
echo "Done." That's it, you're done. Good luck! |
Beta Was this translation helpful? Give feedback.
-
How is there not a proper solution for this yet |
Beta Was this translation helpful? Give feedback.
You can’t remove it yet, but it won’t be there forever. You can’t delete it yet but we’ll have functionality to delete this in the future.