Skip to content

Commit 0485d8f

Browse files
DEVOPS-62 updated readme
1 parent 035fc58 commit 0485d8f

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: github-automation-to-fetch-remaining-github-runner-time
2+
on:
3+
schedule:
4+
- cron: '0 0 * * 0' # weekly once
5+
workflow_dispatch:
6+
inputs:
7+
organization:
8+
description: 'GitHub organization name'
9+
required: true
10+
type: string
11+
default: 'devwithkrishna'
12+
account_name:
13+
description: 'GitHub user account name'
14+
default: 'githubofkrishnadhas'
15+
type: string
16+
required: true
17+
jobs:
18+
github-automation-to-fetch-remaining-github-runner-time:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: git checkout
22+
uses: actions/checkout@v4
23+
- name: set up python 3.10
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.10'
27+
- name: package installations
28+
run: |
29+
pip install pipenv
30+
pipenv install
31+
- name: execute python program
32+
env:
33+
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
34+
run: |
35+
pipenv run python3 github_billing.py --organization ${{ inputs.organization }} --account_name ${{ inputs.account_name }}
36+
- name: Completed
37+
run: |
38+
echo "program completed successfully"

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,30 @@ An automation to pull github free runner time remaining for my account and mail
33

44
## Reference
55
[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)
6+
7+
# What does this repo do
8+
9+
```
10+
This repo uses github rest api to pull billing details for github org and user account. this iswritten to json files.
11+
Later these json files are dropped as an email using sendgrid to ownerof account. Email consists of multiple json atachments
12+
```
13+
14+
# SendGrid
15+
16+
```
17+
SendGrid is a cloud-based service that provides email delivery and management for businesses. Sendgrid is used to send email
18+
using its python SDK - sendgrids
19+
```
20+
21+
# parameters
22+
23+
| input name | type | description | required |
24+
|-----------------|------|--------------------------------------------------------|----------|
25+
| organization | string | Github organizarion name. Default - `devwithkrishna` | :heavy_check_mark: |
26+
| account_name | string | GitHub account name. Default - `githubofkrishnadhas` | :heavy_check_mark: |
27+
28+
# Files
29+
* send_email.py --> sends a single file attachment with email
30+
* send_email_using_sendgrid.py --> sends multiple json files in a single email.
31+
* github_billing.py --> this will pull billing details using github rest api
32+
* email_template.html --> email html template

0 commit comments

Comments
 (0)