Skip to content

Clone Traffic Tracker #55

Clone Traffic Tracker

Clone Traffic Tracker #55

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