Check for a new lunch menu #198
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: Check for a new lunch menu | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| Check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - run: ./run.sh | |
| - name: Check for Changes | |
| id: check_changes | |
| run: | | |
| if [[ -n "$(git diff --exit-code)" ]]; then | |
| echo "Changes detected." | |
| echo "HAS_CHANGES=true" >> $GITHUB_ENV | |
| else | |
| echo "No changes detected." | |
| echo "HAS_CHANGES=false" >> $GITHUB_ENV | |
| fi | |
| - name: Commit and Push Changes | |
| if: ${{ env.HAS_CHANGES == 'true' }} | |
| run: | | |
| git config --global user.name "${{ github.actor }}" | |
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
| git add . | |
| git commit -m 'New menu detected' | |
| git push | |
| cat url.txt >> $GITHUB_STEP_SUMMARY | |
| exit 1 |