CheckForChanges #3
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: CheckForChanges | ||
on: | ||
schedule: | ||
- cron: "45 11 * * *" | ||
jobs: | ||
checkForChanges: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20.x" | ||
- name: Scrape markets | ||
run: | | ||
cd ./scraper | ||
npm install | ||
npm run leipzigde | ||
git diff markets_leipzig_de.json | echo >> git_diff.txt | ||
export HAS_CHANGES = [ -s git_diff.txt ] && TRUE | ||
- name: Upload Weihnachtsmärkte | ||
if: ${{ HAS_CHANGES }} | ||
Check failure on line 24 in .github/workflows/check_for_changes.yml GitHub Actions / CheckForChangesInvalid workflow file
Check failure on line 24 in .github/workflows/check_for_changes.yml GitHub Actions / CheckForChangesInvalid workflow file
Check failure on line 24 in .github/workflows/check_for_changes.yml GitHub Actions / CheckForChangesInvalid workflow file
|
||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: weihnachts_maerkte_leipzigde.json | ||
path: markets_leipzig_de.json | ||
retention-days: 1 | ||
- name: Upload Diff | ||
if: ${{ HAS_CHANGES }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: git_diff.txt | ||
path: git.diff | ||
retention-days: 1 | ||
- name: FailOnChanges | ||
if: ${{ HAS_CHANGES }} | ||
run: exit 1 |