-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (42 loc) · 1.46 KB
/
scan-users.yml
File metadata and controls
50 lines (42 loc) · 1.46 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Daily User Scan
on:
schedule:
- cron: "0 0 1,8,15,22,29 * *" # Days 1,8,15,22,29 → 00:00
- cron: "26 3 2,9,16,23,30 * *" # Days 2,9,16,23,30 → 03:26
- cron: "51 6 3,10,17,24,31 * *" # Days 3,10,17,24,31 → 06:51
- cron: "17 10 4,11,18,25 * *" # Days 4,11,18,25 → 10:17
- cron: "43 13 5,12,19,26 * *" # Days 5,12,19,26 → 13:43
- cron: "9 17 6,13,20,27 * *" # Days 6,13,20,27 → 17:09
- cron: "34 20 7,14,21,28 * *" # Days 7,14,21,28 → 20:34
workflow_dispatch: # Allow manual trigger
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: Run user scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec tsx scripts/scan-users.ts
- name: Commit and push results
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
if git diff --quiet; then
echo "No changes detected"
else
git add data/scan-results.json
git commit -m "chore: daily user scan - $(date -u +'%Y-%m-%d')"
git fetch origin main
git merge --no-edit origin/main
git push
fi