-
Notifications
You must be signed in to change notification settings - Fork 9
30 lines (25 loc) · 833 Bytes
/
main.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
name: Update profile views
on:
schedule:
- cron: '0 * * * *' # Runs every hour
push:
branches:
- main
jobs:
update-views:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update profile views count
run: |
VIEWS=$(curl -s https://api.github.com/repos/Boubker10/SafeDriveVision/traffic/views | jq '.count')
BADGE="https://img.shields.io/badge/Profile%20views-${VIEWS}-blue"
echo "![$VIEWS]($BADGE)" > views.md
- name: Commit changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add views.md
git commit -m "Update profile views badge"
git push