{"id":4017,"date":"2023-02-27T15:51:18","date_gmt":"2023-02-27T15:51:18","guid":{"rendered":"https:\/\/www.gubatron.com\/blog\/?p=4017"},"modified":"2023-02-27T16:04:09","modified_gmt":"2023-02-27T16:04:09","slug":"4017","status":"publish","type":"post","link":"https:\/\/www.gubatron.com\/blog\/4017\/","title":{"rendered":"Mass delete Github Workflow Run Logs with this script"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4018\" src=\"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-27-at-8.47.56-AM.png?resize=238%2C140&#038;ssl=1\" alt=\"\" width=\"238\" height=\"140\" \/><\/p>\n<p>Github workflow doesn&#8217;t allow mass deletion of Workflow Action run logs, it takes 2 clicks to delete each run log.<\/p>\n<p>If you wanted to delete hundreds of these, the only way is to script something.<\/p>\n<p>Luckily you can do so using the <strong>gh<\/strong> Github Command Line Tool and some json parsing using the <strong>jq<\/strong> tool.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/gubatron\/47552e1bfa345a142b2248be1925efb6.js\"><\/script><\/p>\n<p><strong>Requirements<\/strong><br \/>\ngh &#8211; brew install gh<br \/>\njq &#8211; brew install jq<\/p>\n<p>This is how a successful run is supposed to look like, it will delete 30 logs at the time:<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4019\" src=\"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-27-at-8.50.39-AM.png?resize=463%2C740&#038;ssl=1\" alt=\"\" width=\"463\" height=\"740\" srcset=\"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-27-at-8.50.39-AM.png?w=463&amp;ssl=1 463w, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-27-at-8.50.39-AM.png?resize=188%2C300&amp;ssl=1 188w, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-27-at-8.50.39-AM.png?resize=438%2C700&amp;ssl=1 438w\" sizes=\"auto, (max-width: 463px) 100vw, 463px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Github workflow doesn&#8217;t allow mass deletion of Workflow Action run logs, it takes 2 clicks to delete each run log. If you wanted to delete hundreds of these, the only way is to script something. Luckily you can do so using the gh Github Command Line Tool and some json parsing using the jq tool. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[15],"tags":[1663,1331,1574,1662],"class_list":["post-4017","post","type-post","status-publish","format-standard","hentry","category-code","tag-devops","tag-github","tag-ops","tag-workflows"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s5Unzf-4017","jetpack-related-posts":[{"id":3215,"url":"https:\/\/www.gubatron.com\/blog\/building-cgminer-from-source-on-osx\/","url_meta":{"origin":4017,"position":0},"title":"building cgminer from source on OSX","author":"gubatron","date":"January 19, 2014","format":false,"excerpt":"so you cloned the cgminer repo from github to build on your OSX machine and you get this bullshit error $ .\/autogen.sh readlink: illegal option -- f usage: readlink [-n] [file ...] usage: dirname path touch: \/ltmain.sh: Permission denied Use of chdir('') or chdir(undef) as chdir() is deprecated at \/usr\/local\/bin\/autoreconf\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2068,"url":"https:\/\/www.gubatron.com\/blog\/bitbucket-or-github\/","url_meta":{"origin":4017,"position":1},"title":"Bitbucket or Github?","author":"gubatron","date":"September 28, 2010","format":false,"excerpt":"This week we have to make a final choice of what technology will be used to replace our somewhat big subversion repository (2 Gigs). Huge imports are beginning to be a pain and we're tired of the .svn folders and not being able to commit if the central server is\u2026","rel":"","context":"In &quot;Geeklife&quot;","block_context":{"text":"Geeklife","link":"https:\/\/www.gubatron.com\/blog\/category\/geeklife\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3150,"url":"https:\/\/www.gubatron.com\/blog\/how-to-add-an-existing-git-repository-to-github\/","url_meta":{"origin":4017,"position":2},"title":"How to add an existing GIT repository to github.","author":"gubatron","date":"August 31, 2013","format":false,"excerpt":"Most of the times, it makes more sense to start working on something that slowly transforms into the beginning of a project that deserves to be on github. This post is about creating a local repository and putting it on github. 1. First we must convert the main local folder\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4122,"url":"https:\/\/www.gubatron.com\/blog\/screw-configuring-gpg-to-sign-git-commits-do-it-with-your-same-ssh-key-like-this\/","url_meta":{"origin":4017,"position":3},"title":"Screw configuring GPG to sign git commits, do it with your same SSH key like this","author":"gubatron","date":"January 30, 2025","format":false,"excerpt":"GPG gives a lot of shit on macos for some reason. It's best to just add the same SSH authentication key you have on github as a \"Signing Key\" in your github account signing configuration. Go to Settings > SSH and GPG Keys You can then configure your github client\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2025\/01\/ssh_sign.jpg?fit=736%2C441&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2025\/01\/ssh_sign.jpg?fit=736%2C441&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2025\/01\/ssh_sign.jpg?fit=736%2C441&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2025\/01\/ssh_sign.jpg?fit=736%2C441&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4024,"url":"https:\/\/www.gubatron.com\/blog\/6-sites-where-veteran-java-developers-can-earn-money-by-bounty-hunting\/","url_meta":{"origin":4017,"position":4},"title":"Java Pros: Discover 6 Websites to Boost Your Income through Bounties","author":"gubatron","date":"April 5, 2023","format":false,"excerpt":"A Java programming veteran can find easy bounties on various platforms where developers can earn rewards for contributing to open-source projects, solving coding challenges, or participating in bug bounty programs. Some of these platforms include:1 GitHubExplore open-source Java projects on GitHub and look for repositories with \"good first issue\" or\u2026","rel":"","context":"In &quot;Howto&quot;","block_context":{"text":"Howto","link":"https:\/\/www.gubatron.com\/blog\/category\/howto-2\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/04\/gubatron_java_developer_public_domain.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/04\/gubatron_java_developer_public_domain.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/04\/gubatron_java_developer_public_domain.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/04\/gubatron_java_developer_public_domain.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/04\/gubatron_java_developer_public_domain.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1118,"url":"https:\/\/www.gubatron.com\/blog\/delete-all-direct-messages-of-your-twitter-account-at-once-or-at-least-try\/","url_meta":{"origin":4017,"position":5},"title":"Delete All Direct Messages of your Twitter Account at once (or at least try!)","author":"gubatron","date":"February 13, 2009","format":false,"excerpt":"Since Twitter doesn't provide with a \"Delete All Direct Messages\" functionality, Here's a Python script that attempts to delete all the direct messages stored on your Twitter account. Limitations The only problem with it is that given the limitations of the Twitter REST API, I was forced to send a\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/4017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/comments?post=4017"}],"version-history":[{"count":4,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/4017\/revisions"}],"predecessor-version":[{"id":4023,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/4017\/revisions\/4023"}],"wp:attachment":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/media?parent=4017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/categories?post=4017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/tags?post=4017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}