Skip to content

Instantly share code, notes, and snippets.

View satishsurath's full-sized avatar

Satish Surath satishsurath

View GitHub Profile

How to Bulk Delete GitHub Actions Artifacts with a Simple Script (MacOS Guide)

https://dev.to/muhammadaqib86/how-to-bulk-delete-github-actions-artifacts-with-a-simple-script-macos-guide-38bh

#github#devops#automation#githubactions

If you're using GitHub Actions, you know how quickly artifacts can accumulate and consume your storage quota. In this post, I'll show you how to clean up all your GitHub Actions artifacts across all repositories with a simple bash script - no manual deletion required!

Why Delete GitHub Actions Artifacts?

With GitHub Actions, a workflow can publish artifacts, typically logs or binaries. As of early 2020, the life time of an artifact is hard-coded to 90 days (this may change in the future). After 90 days, an artifact is automatically deleted. But, in the meantime, artifacts for a repository may accumulate and generate mega-bytes or even giga-bytes of data files.

It is unclear if there is a size limit for the total accumulated size of artifacts for a public repository. But GitHub cannot reasonably let multi-giga-bytes of artifacts data accumulate without doing anything. So, if your workflows regularly produce large artifacts (such as "nightly build" procedures for instance), it is wise to cleanup and delete older artifacts without waiting for the 90 days limit.

Using the Web page for the "Actions" of a repository, it is possible to browse old workflow runs and manually delete artifacts. But the procedure is slow and tedious. It is fine to delete one selected artifact. It is not for a regular cleanup. We need

@satishsurath
satishsurath / video_info.py
Created February 20, 2024 02:14 — forked from yogeshsinghgit/video_info.py
Get YouTube Video Information/Metadata using Python Pytube Module
# importing the module
from pytube import YouTube
# Function Takes YouTube Object as Argument.
def video_Info(yt):
print("Title : ",yt.title)
print("Total Length : ",yt.length," Seconds")
print("Total Views : ",yt.views)
print("Is Age Restricted : ",yt.age_restricted)
print("Video Rating ",round(yt.rating))
@satishsurath
satishsurath / Globally ignoring DS_Store (for Mac).md
Last active April 1, 2023 00:49
Permanently add DS_Store into .gitignore files (for Mac)

Permanently add DS_Store into .gitignore files (for Mac)

git config --global core.excludesfile ~/.gitignore_global 
echo .DS_Store >> ~/.gitignore_global