Fetch GitHub API Data #1428
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: Fetch GitHub API Data | |
| on: | |
| schedule: | |
| - cron: "0 * * * *" | |
| workflow_dispatch: | |
| jobs: | |
| fetch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout gh-pages branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: gh-pages | |
| - name: Fetch GitHub Repository Data | |
| run: | | |
| curl -H "Authorization: token ${{ secrets.GH_API_TOKEN }}" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| https://api.github.com/repos/almenscorner/intune-uploader \ | |
| | jq 'del(.pushed_at, .size)' > data/github.json | |
| - name: Fetch GitHub Contributors | |
| run: | | |
| curl -H "Authorization: token ${{ secrets.GH_API_TOKEN }}" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| https://api.github.com/repos/almenscorner/intune-uploader/contributors \ | |
| > data/contributors.json | |
| - name: Commit & Push Changes to gh-pages | |
| run: | | |
| git config --global user.email "actions@github.com" | |
| git config --global user.name "GitHub Actions" | |
| git add data/github.json data/contributors.json | |
| git commit -m "Update GitHub API cache [skip ci]" || exit 0 | |
| git push origin gh-pages |