Skip to content

Retrieve South Walton, Florida Beach Flag Status #9540

Retrieve South Walton, Florida Beach Flag Status

Retrieve South Walton, Florida Beach Flag Status #9540

name: Retrieve South Walton, Florida Beach Flag Status
on:
push:
branches:
- main
schedule:
- cron: "30 * * * *" # Runs 30 minutes past every hour
workflow_dispatch:
jobs:
populate-current-flag-status:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.4.0'
cache: 'npm'
cache-dependency-path: current-flag-status/package-lock.json
- name: Install Depdendencies
run: npm ci
working-directory: current-flag-status
- name: Run Flag Status Retrieval Script
run: node current-flag-status/retrieve-current-flag-status.js
- name: Commit Flag Status File
run: |
git config --global user.name 'Paul Rosenthal'
git config --global user.email 'Paul.H.Rosenthal@iCloud.com'
# The lines below first assess if the "current-flag-status.txt" has changed. If the file
# is unchanged, the command exits with a 0. If there are differences, a non-zero value
# will be returned and the second portion of the command following the "||" operator will
# be run.
git diff --quiet current-flag-status.txt \
|| (git add current-flag-status.txt \
&& git commit -m "[Automatic Commit] Update Beach Flag Status" \
&& git push)