Fetch the Latest Insights Data #806
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 the Latest Insights Data | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 18 * * *' | |
| push: | |
| branches: | |
| - main | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| jobs: | |
| fetch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out source code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' # caching pip dependencies | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Update JSON data | |
| run: python main.py -t ${{ env.GH_TOKEN }} | |
| - name: Commit and push changes | |
| run: |- | |
| git add . | |
| git diff | |
| git config --global user.email "github-action-bot@specterops.io" | |
| git config --global user.name "GitHub Action Bot" | |
| git commit -m "Updated insights data" -a || echo "No changes to commit" | |
| git push |