Skip to content

Commit b93d6ae

Browse files
committed
feat: Log Current Date For Active Action
1 parent daf7b22 commit b93d6ae

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/workflows/ci.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 该脚本是为了避免脚本自动关闭(Github 公共仓库无代码活动60天自动关闭 Action)
2+
3+
name: Log Current Date For Active Action
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 0 1 * *' # 每月1日时运行
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Current date
18+
run: |
19+
bash day.sh
20+
21+
- name: Commit and push if changed
22+
run: |-
23+
git diff
24+
git config --global user.email "[email protected]"
25+
git config --global user.name "JS-banana"
26+
git pull
27+
git add -A
28+
git commit -m "Updated current date" || exit 0
29+
git push

day.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
name="js-banana"
4+
echo $name
5+
6+
echo "BACKUP DATE:" $(date +"%Y-%m-%d %H:%M:%S")
7+
8+
DATE=`date '+%Y%m%d-%H%M%S'`
9+
echo $DATE
10+
11+
LogNameDATE=`date '+%Y%m%d'`
12+
13+
echo "UPDATE DATE:" $(date +"%Y-%m-%d %H:%M:%S") >> day.txt

day.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)