Update Data #2
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: Update Data | |
# Schedule the workflow to run once a week | |
on: | |
schedule: | |
- cron: '30 9 * * 0' # Runs every Sunday at 09:30 AM (02:30 MT) | |
jobs: | |
weekly-task: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install Dependencies | |
run: npm install | |
- name: Check Date and Run Script | |
run: | | |
# Get the current date | |
current_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
# Define start and end dates | |
start_date="2024-07-01T00:00:00Z" | |
end_date="2024-11-24T23:59:59Z" | |
# Compare dates | |
if [[ "$current_date" > "$start_date" && "$current_date" < "$end_date" ]]; then | |
echo "Current date is within the specified range. Running the script..." | |
node airtable.js | |
else | |
echo "Current date is outside the specified range. Skipping the task." | |
fi |