quatalog-scraper/.github/workflows/transfer.yml

29 lines
1.1 KiB
YAML
Raw Normal View History

2024-02-29 22:16:39 +00:00
name: Scrape transfer and update file
run-name: Scrape transfer and update file
2024-03-01 17:48:20 +00:00
env:
DEFAULT_TIMEOUT: 45
2024-02-29 22:16:39 +00:00
on:
workflow_dispatch:
jobs:
2024-03-05 23:27:51 +00:00
starter:
2024-02-29 22:16:39 +00:00
runs-on: ubuntu-latest
steps:
2024-03-05 23:27:51 +00:00
- name: Create matrix parameters
id: matrix-params
run: |
NUM_PAGES="$(curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0' 'https://tes.collegesource.com/publicview/TES_publicview01.aspx?rid=f080a477-bff8-46df-a5b2-25e9affdd4ed&aid=27b576bb-cd07-4e57-84d0-37475fde70ce' | grep -e 'lblInstWithEQPaginationInfo' | grep -Poie '(?<=of )[0-9]*')"
MATRIX_PARAMS="$(seq -s "," 1 "$NUM_PAGES")"
MATRIX_PARAMS="\"page\": $(sed -e 's/,/}, {"page": /g' <<< "$MATRIX_PARAMS")"
echo "matrix-params={\"include\": [{ "$MATRIX_PARAMS" }]}" | tee $GITHUB_OUTPUT
outputs:
matrix-params: ${{ steps.matrix-params.outputs.matrix-params }}
matrix-job:
runs-on: ubuntu-latest
2024-03-05 23:27:51 +00:00
needs: starter
strategy:
matrix: ${{ fromJson(needs.starter.outputs.matrix-params) }}
steps:
2024-03-05 23:27:51 +00:00
- run: |
echo ${{ matrix.page }}