Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/fetch-event-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,26 @@ jobs:
node-version: '24.x' # Or any version you prefer
cache: pnpm

# Step 3: Install Node.js dependencies
# Step 3: Restore existing events from the event-data branch so past events are preserved
- name: Restore existing events
run: |
git fetch origin event-data || true
git checkout origin/event-data -- scheduled_events.json || true

# Step 4: Install Node.js dependencies
- name: Install dependencies
run: pnpm install
working-directory: 'automation'

# Step 4: Run the Node.js script to fetch events and save to a file
# Step 5: Run the Node.js script to fetch events and save to a file
- name: Fetch and save events
run: node get_events.js
working-directory: 'automation'
env:
# Use the GitHub Secret we created to pass the token
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}

# Step 5: Commit the new JSON file back to the repository
# Step 6: Commit the new JSON file back to the repository
- name: Commit and push changes
run: |
git config user.name github-actions
Expand Down