Fetch Repo Traffic Stats #13
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
| on: | |
| schedule: | |
| - cron: "0 0 */14 * *" | |
| workflow_dispatch: | |
| jobs: | |
| # This workflow contains a single job called "traffic" | |
| traffic: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Give the default GITHUB_TOKEN write permission to commit and push the | |
| # added or changed files to the repository. | |
| contents: write | |
| steps: | |
| - name: Checkout current repo | |
| uses: actions/checkout@v4.1.1 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5.0.0 | |
| with: | |
| python-version: '3.10' | |
| - name: install depedencies | |
| run: pip install requests | |
| - name: Run Python script to generate summary | |
| run: python3 github_stats.py | |
| env: | |
| TRAFFIC_ACTION_TOKEN: ${{ secrets.GHRS_GITHUB_API_TOKEN }} | |
| TRAFFIC_ACTION_OWNER: ${{ secrets.TRAFFIC_ACTION_OWNER }} | |
| TRAFFIC_ACTION_REPO: ${{ secrets.TRAFFIC_ACTION_REPO }} | |
| - name: view summary file | |
| run: cat traffic/summary.csv | |
| - name: list generated files | |
| run: ls -ltrh | |
| - name: Commit and push changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "Update CSV with new data from github action" |