github-automation-to-fetch-remaining-github-runner-time #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: github-automation-to-fetch-remaining-github-runner-time | |
on: | |
schedule: | |
- cron: '0 0 * * 0' # weekly once | |
workflow_dispatch: | |
inputs: | |
organization: | |
description: 'GitHub organization name' | |
required: true | |
type: string | |
default: 'devwithkrishna' | |
account_name: | |
description: 'GitHub user account name' | |
default: 'githubofkrishnadhas' | |
type: string | |
required: true | |
jobs: | |
github-automation-to-fetch-remaining-github-runner-time: | |
runs-on: ubuntu-latest | |
steps: | |
- name: git checkout | |
uses: actions/checkout@v4 | |
- name: set up python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: package installations | |
run: | | |
pip install pipenv | |
pipenv install | |
- name: execute python program | |
env: | |
organization: 'devwithkrishna' | |
account_name: 'githubofkrishnadhas' | |
GH_TOKEN: ${{ secrets.DEVWITHKRISHNA_PERSONAL_ACCESS_TOKEN }} | |
GH_TOKEN_CLASSIC: ${{ secrets.GH_TOKEN_CLASSIC }} | |
run: | | |
pipenv run python3 github_billing.py --organization ${{ env.organization }} --account_name ${{ env.account_name }} | |
- name: send email program | |
env: | |
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }} | |
run: | | |
pipenv run python3 send_email_using_sendgrid.py | |
- name: Completed | |
run: | | |
echo "program completed successfully" |