Daily Commit Link and POTD Badge Tracker #10
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: Daily Commit Link and POTD Badge Tracker | |
on: | |
push: | |
branches: | |
- main # or your default branch name | |
schedule: | |
- cron: '0 0 * * *' # This will run daily at midnight UTC | |
workflow_dispatch: | |
jobs: | |
update-link: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install requests | |
run: pip install requests | |
- name: Update README with the Latest Commit | |
run: python src/update_commit.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} README.md | |
- name: Commit and Push Changes | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add README.md | |
git diff-index --quiet HEAD || git commit -m "Update latest commit and POTD badge" | |
git push |