-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 951 Bytes
/
main.yml
File metadata and controls
31 lines (31 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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