Daily Contribution #204
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: Daily Contribution | |
| permissions: | |
| contents: write | |
| on: | |
| schedule: | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| contribute: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Random delay | |
| run: | | |
| sleep $((RANDOM % 21600)) | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "NABORAJ SARKAR" | |
| git config --global user.email "nishant.ns.business@gmail.com" | |
| - name: Create contribution file | |
| run: | | |
| export TZ=Asia/Kolkata | |
| mkdir -p logs | |
| DATE=$(date +%F) | |
| TIME=$(date +"%H:%M:%S") | |
| echo "Contribution on $DATE at $TIME - $RANDOM" > logs/today.txt | |
| - name: Commit changes | |
| run: | | |
| git add . | |
| git commit -m "chore: daily contribution" || echo "No changes to commit" | |
| - name: Push changes | |
| run: | | |
| git push |