-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.05 KB
/
dailycommit.yml
File metadata and controls
36 lines (33 loc) · 1.05 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
name: Gavin's Totally real commit
on:
schedule:
- cron: '10 17 * * *'
jobs:
commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: main
- name: Create file and commit
run: |
FILE="commit_number.md"
if [ ! -f "$FILE" ]; then
echo "I love auto commit" > "$FILE"
echo "commit number: 1" >> "$FILE"
else
CURRENT_COUNT=$(grep -oP 'commit number: \K\d+' "$FILE")
if [ -z "$CURRENT_COUNT" ]; then
CURRENT_COUNT=0
fi
NEXT_COUNT=$((CURRENT_COUNT + 1))
sed -i "/commit number: /c\commit number: $NEXT_COUNT" "$FILE"
fi
git config --global user.name "Gavin"
git config --global user.email "notcomputerjesus@gmail.com"
git add "$FILE"
git commit -m "Infinite Commit's"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/beesou777/mean-commit.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}