Skip to content

Instantly share code, notes, and snippets.

@adamltyson
Created June 16, 2023 10:58
Show Gist options
  • Select an option

  • Save adamltyson/abff41d37f327de3e10a34204581650e to your computer and use it in GitHub Desktop.

Select an option

Save adamltyson/abff41d37f327de3e10a34204581650e to your computer and use it in GitHub Desktop.
Summarise github actions billing report
# To use, download GitHub usage report from the organisation
# billing tab then run e.g.:
# `python actions_billing_summary.py file.csv`
import sys
import pandas as pd
actions_csv = sys.argv[1]
df = pd.read_csv(actions_csv)
df = df[df['Product'] == 'Actions']
df["Total"] = df["Quantity"] * df["Multiplier"]
df = df.groupby(["Repository Slug"]).sum()
df = df.sort_values(by=['Total'], ascending=False)
print(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment