Gavin's Totally real commit #40
This file contains hidden or 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: 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 }} |