Repository navigation
71 lines (62 loc) · 1.75 KB
/
Copy pathcrawl.yml
File metadata and controls
71 lines (62 loc) · 1.75 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: crawl
on:
workflow_dispatch:
inputs:
dry_run:
description: "Run without committing"
type: boolean
default: false
limit:
description: "Limit results per kind (0 = no limit)"
type: string
default: "0"
kind:
description: "Kind to crawl (empty = all)"
type: choice
options: ["", "whoami", "whois", "whatis"]
default: ""
# Uncomment to enable daily scheduled crawl at 03:00 UTC
# schedule:
# - cron: "0 3 * * *"
permissions:
contents: write
jobs:
crawl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Run crawler
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ARGS=""
if [ "${{ inputs.dry_run }}" = "true" ]; then
ARGS="$ARGS --dry-run"
fi
if [ "${{ inputs.limit }}" != "0" ] && [ -n "${{ inputs.limit }}" ]; then
ARGS="$ARGS --limit ${{ inputs.limit }}"
fi
if [ -n "${{ inputs.kind }}" ]; then
ARGS="$ARGS --kind ${{ inputs.kind }}"
fi
node dist/crawl.js $ARGS
- name: Commit changes
if: ${{ inputs.dry_run != 'true' }}
run: |
git config user.name "declared-md-bot"
git config user.email "bot@declared-md.org"
git add data/ invalid/
if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
fi
git commit -m "chore: crawl run $(date -u +%Y-%m-%dT%H:%M:%SZ)"
git push