https://github.com/devwithkrishna/github-automation-to-fetch-remaining-github-runner-time
An automation to pull github free runner time remaining for my account and mail it to admins weekly
https://github.com/devwithkrishna/github-automation-to-fetch-remaining-github-runner-time
github github-billing github-runner github-workflow multiple-email-attachment python sendgrid
Last synced: 11 months ago
JSON representation
An automation to pull github free runner time remaining for my account and mail it to admins weekly
- Host: GitHub
- URL: https://github.com/devwithkrishna/github-automation-to-fetch-remaining-github-runner-time
- Owner: devwithkrishna
- License: mit
- Created: 2024-05-04T11:59:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-07T08:48:04.000Z (over 1 year ago)
- Last Synced: 2025-01-16T00:55:54.067Z (about 1 year ago)
- Topics: github, github-billing, github-runner, github-workflow, multiple-email-attachment, python, sendgrid
- Language: Python
- Homepage: https://github.com/devwithkrishna/github-automation-to-fetch-remaining-github-runne-time
- Size: 43 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-automation-to-fetch-remaining-github-runne-time
An automation to pull github free runner time remaining for my account and mail it to admins weekly
## Reference
[get-github-actions-billing-for-an-organization](https://docs.github.com/en/rest/billing/billing?apiVersion=2022-11-28#get-github-actions-billing-for-an-organization)
# What does this repo do
```
This repo uses github rest api to pull billing details for github org and user account. this iswritten to json files.
Later these json files are dropped as an email using sendgrid to ownerof account. Email consists of multiple json atachments
```
# Credentials used for authorization
| credential | purpose | check |
|------------------------------------|------------------------------------------------------------------------|--------------------|
| fine grained personal access token | this is used for all purpose like listing repos, github app detailsetc | :heavy_check_mark: |
| personal access token classic | this is used for api call to add repos to github app | :heavy_check_mark: |
| sendgrid api key | this is used for amiling purpose to auth with user account | :heavy_check_mark: |
# SendGrid
```
SendGrid is a cloud-based service that provides email delivery and management for businesses. Sendgrid is used to send email
using its python SDK - sendgrids
```
# parameters
| input name | type | description | required |
|-----------------|------|--------------------------------------------------------|----------|
| organization | string | Github organizarion name. Default - `devwithkrishna` | :heavy_check_mark: |
| account_name | string | GitHub account name. Default - `githubofkrishnadhas` | :heavy_check_mark: |
# Files
* send_email.py --> sends a single file attachment with email
* send_email_using_sendgrid.py --> sends multiple json files in a single email.
* github_billing.py --> this will pull billing details using github rest api
* email_template.html --> email html template