-
Notifications
You must be signed in to change notification settings - Fork 3
32 lines (27 loc) · 1.09 KB
/
pull_clone_traffic.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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