-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (40 loc) · 1.58 KB
/
Copy pathmain.yml
File metadata and controls
50 lines (40 loc) · 1.58 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: Google Voice Keep Alive & Auto Log
on:
schedule:
# Runs at 00:00 UTC on the 1st of every month (08:00 Beijing Time)
- cron: '0 0 1 * *'
workflow_dispatch: # Allows manual triggering for testing
permissions:
contents: write
jobs:
keep-alive-job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches full history to allow branch switching
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Run Python Script (Send SMS)
env:
GMAIL_USER: ${{ secrets.GMAIL_USER }}
GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }}
GV_GATEWAY: ${{ secrets.GV_GATEWAY }}
run: python main.py
- name: Update Log and Push to Separate Branch
run: |
# 1. Configure Git Identity
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# 2. Create or switch to the 'logs' branch
# This ensures that log updates don't clutter the main branch for forkers
git checkout logs 2>/dev/null || git checkout -b logs
# 3. Update the log file
echo "Run at $(date -u) UTC" >> keepalive.log
# 4. Commit and Push to the 'logs' branch specifically
git add keepalive.log
git commit -m "chore: update keepalive log [skip ci]" || echo "No changes to commit"
git push origin logs