Skip to content

Commit 5221b79

Browse files
authored
Create main.yml
1 parent 654693d commit 5221b79

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: python script
2+
3+
on:
4+
workflow_dispatch:
5+
# Trigger manually once, and it will loop
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update-timestamp:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Run every 5 minutes in a loop
16+
run: |
17+
git config user.name "brutal-45"
18+
git config user.email "creatorsports81@gmail.com"
19+
20+
# Run for 5 hours (60 iterations x 5 minutes = 300 minutes)
21+
for i in {1..60}; do
22+
TIMESTAMP_FILE="updates.txt"
23+
echo "Last checked: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" > "$TIMESTAMP_FILE"
24+
git add "$TIMESTAMP_FILE"
25+
26+
if ! git diff --cached --quiet; then
27+
git commit -m "python script: $(date -u)"
28+
git push origin HEAD
29+
fi
30+
31+
echo "Waiting 5 minutes..."
32+
sleep 300
33+
done

0 commit comments

Comments
 (0)