Automated Commit #383
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: Automated Commit | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Git | |
| run: | | |
| git config --global user.email "alireza.g7743@gmail.com" | |
| git config --global user.name "Alirezag23" | |
| - name: Select Random Sticker | |
| id: random_sticker | |
| run: | | |
| LINES=$(wc -l < stickers.txt) | |
| RAND=$(( ( RANDOM % LINES ) + 1 )) | |
| STICKER=$(sed -n "${RAND}p" stickers.txt) | |
| echo "::set-output name=sticker::$STICKER" | |
| - name: Make a commit | |
| run: | | |
| echo "Commit made at $(date) with sticker: ${{ steps.random_sticker.outputs.sticker }}" >> commit-log.txt | |
| git add commit-log.txt | |
| git commit -m "Automated commit with sticker: ${{ steps.random_sticker.outputs.sticker }}" | |
| git push https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main |