Skip to content

Commit

Permalink
Update mirror step to download index from https://gutendex.com api
Browse files Browse the repository at this point in the history
  • Loading branch information
norwd authored Dec 10, 2024
1 parent 9d2a01e commit 46f9233
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,19 @@ jobs:
uses: actions/checkout@v4

- name: "Mirror"
run: echo "${workflow_ref}" > .test # for testing, will change
run: |
while [ "${ENDPOINT}" ]
do
ENDPOINT="$(curl -sS "${ENDPOINT}" | tee -a "${TMP_FILE}" | jq --raw-output "${JQ_QUERY}")"
done
jq --slurp '[.[].results[]]' "${TMP_FILE}" | tee -a "index.json"
# TODO: download files listed in index
env:
workflow_ref: ${{ github.workflow_ref }}
ENDPOINT: 'https://gutendex.com/books/?languages=eo'
JQ_QUERY: '.next|tostring|sub("^null$"; ""; "i")'
TMP_FILE: '${{ runner.temp }}/results'

- name: "Add files"
run: git add .
Expand Down

0 comments on commit 46f9233

Please sign in to comment.