Clone Traffic Tracker #19
This file contains 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: Clone Traffic Tracker | |
on: | |
workflow_dispatch: # Manual triggering | |
schedule: | |
- cron: "0 0 * * 1" # Automated schedule (every 2 weeks on Monday) | |
jobs: | |
track-clone-traffic: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Fetch Clone Traffic | |
run: | | |
# Use GitHub API to fetch clone statistics | |
# You may need to provide a token with appropriate permissions | |
# Log the results to a file | |
curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -o clone_traffic.json https://api.github.com/repos/${{ github.repository }}/traffic/clones | |
echo "$(date): Clone Traffic Data: $(cat clone_traffic.json)" >> clone_traffic.log | |
- name: List Files in Workspace | |
run: ls -R | |
- name: Commit the results to the repo | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add -f clone_traffic.log | |
git commit --allow-empty -m "add traffic logs" | |
git push |