Skip to content

Fetch GitHub API Data #2605

Fetch GitHub API Data

Fetch GitHub API Data #2605

Workflow file for this run

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