generated from PaulRosenthal/Panama-City-Beach-Flags-Alexa-Skill
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.32 KB
/
populate-current-flag-status.yml
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
32
33
34
35
36
37
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)