auto-commit #48
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: | |
schedule: | |
- cron: '0 2 * * 1-5' | |
workflow_dispatch: | |
jobs: | |
auto-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
ref: auto-commit | |
- name: Set up Git | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "[email protected]" | |
- name: Make changes | |
run: | | |
echo "Last updated: $(date)" > last_updated.txt | |
git add last_updated.txt | |
- name: Commit changes | |
run: git commit -m "Automated commit - $(date)" || echo "No changes to commit" | |
- name: Push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git push origin HEAD |