Fetch latest schedules #10
This file contains hidden or 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: "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' |