Skip to content

Fetch latest schedules #5

Fetch latest schedules

Fetch latest schedules #5

Workflow file for this run

name: "Fetch latest schedules"
on:
schedule:
- cron: "* 5 * * *"
workflow_dispatch:
jobs:
get-update-schedule:
name: "Get the latest update schedule"
runs-on: ubuntu-latest
steps:
- name: Retrieve yesterdays day of the week
id: day-of-week
run: echo "DAY=$(date -d yesterday +%a | awk '{print tolower($0)}')" >> "$GITHUB_OUTPUT"
- name: Download Update Schedule
run: curl -L -u "${{ secrets.NETWORK_RAIL_USERNAME }}:${{ secrets.NETWORK_RAIL_PASSWORD }}" -o file.gz 'https://publicdatafeeds.networkrail.co.uk/ntrod/CifFileAuthenticate?type=CIF_ALL_UPDATE_DAILY&day=toc-update-${{ steps.day-of-week.outputs.DAY }}.CIF.gz'