GitHub Action for fetching GitHub Action's usage.
In order to use this action, you need to:
- Register new GitHub App and add permission(
admin:org=read
) - Store the App's ID in your repository environment variables (example: APP_ID)
- Store the App's private key in your repository secrets (example: PRIVATE_KEY)
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Fetch GHA Usage
id: gha-usage-fetcher
uses: namipey/gha-usage-fetcher@v1
with:
github_token: ${{ steps.app-token.outputs.token }}
org_name: ${{ github.repository_owner }}
- name: Print Output
run: echo "${{ steps.gha-usage-fetcher.outputs.total_cost }}"