Skip to content

Instantly share code, notes, and snippets.

@abatilo
Created October 9, 2022 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abatilo/e9ba9fe74e90533411d343013490ac92 to your computer and use it in GitHub Desktop.
Save abatilo/e9ba9fe74e90533411d343013490ac92 to your computer and use it in GitHub Desktop.
Example of getting app rate limits
name: Print rate limits
on:
push:
jobs:
rate-limit:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
- env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/rate_limit | jq '.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment