Repository navigation
64 lines (56 loc) · 2.09 KB
/
Copy pathschedule.yml
File metadata and controls
64 lines (56 loc) · 2.09 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
name: Git Auto Commit
on:
schedule:
# Run twice per hour at off-peak minutes (7 and 37) to avoid the
# "round-number" cron pile-up. The script internally randomises
# commit decisions, so not every run produces a commit.
#
# ┌───────── minute (0–59)
# │ ┌───────── hour (0–23 UTC)
# │ │ ┌───────── day of month (1–31)
# │ │ │ ┌───────── month (1–12)
# │ │ │ │ ┌───────── day of week (0–6, 0=Sun)
# │ │ │ │ │
- cron: "7,37 * * * *"
workflow_dispatch:
# Allow manual trigger from the GitHub Actions UI
jobs:
auto-commit:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout this repository (the orchestrator)
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Verify configuration
id: verify
run: |
if [ ! -f config.yaml ]; then
echo "❌ config.yaml not found" >&2
exit 1
fi
if ! python -c "import yaml; yaml.safe_load(open('config.yaml'))" 2>/dev/null; then
echo "❌ config.yaml is not valid YAML" >&2
exit 1
fi
echo "✅ config.yaml present and valid"
- name: Verify token secret is set
id: verify-token
env:
GIT_AUTO_COMMIT_TOKEN: ${{ secrets.GIT_AUTO_COMMIT_TOKEN }}
run: |
if [ -z "$GIT_AUTO_COMMIT_TOKEN" ]; then
echo "❌ GIT_AUTO_COMMIT_TOKEN secret is empty or not set" >&2
exit 1
fi
echo "✅ Token secret is set (length: ${#GIT_AUTO_COMMIT_TOKEN})"
- name: Run auto-commit (one-shot)
if: steps.verify.outcome == 'success' && steps.verify-token.outcome == 'success'
env:
GIT_AUTO_COMMIT_TOKEN: ${{ secrets.GIT_AUTO_COMMIT_TOKEN }}
run: python -m src.main --once