Auto commit #2310
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto commit | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "1 * * * *" | |
jobs: | |
auto_commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: DEBUG | |
run: echo "::debug::Ref = ${{github.ref}}" | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Modify last update | |
run: | | |
d=`date '+%Y-%m-%dT%H:%M:%SZ'` | |
echo $d > LAST_UPDATED | |
- name: Commit changes | |
run: | | |
git pull | |
git config --local user.email "3bsalam0@gmail.com" | |
git config --local user.name "3bsalam-1" | |
git add -A | |
arr[0]="Update.." | |
arr[1]="Update LAST_UPDATED file" | |
arr[2]="Update LAST_UPDATED .." | |
arr[3]="Update LAST_UPDATED file .." | |
arr[4]="LAST_UPDATED file.." | |
arr[5]="Update LAST_UPDATED" | |
arr[6]="LAST_UPDATED file" | |
arr[7]="LAST_UPDATED" | |
arr[8]="LAST_UPDATED.." | |
arr[9]="Update LAST_UPDATED file..." | |
rand=$[$RANDOM % ${#arr[@]}] | |
git commit -m "${arr[$rand]}" | |
- name: GitHub Push | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
branch: main | |
directory: "." | |
github_token: ${{ secrets.GITHUB_TOKEN }} |