-
Notifications
You must be signed in to change notification settings - Fork 28
37 lines (32 loc) ยท 1.02 KB
/
task.yml
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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch: # ๅ
่ฎธๆๅจ่งฆๅๅทฅไฝๆต
schedule:
- cron: "30 23 * * *" # ๆฏๅคฉ 23:30 ่งฆๅไธๆฌก
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create timestamped .md file
run: |
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
echo "Last update time: $timestamp" > "DATA_UPDATE.md"
- name: Commit and push .md file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add DATA_UPDATE.md
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Update DATA_UPDATE.md with timestamp $(date '+%Y-%m-%d %H:%M:%S')"
git push origin main
fi