Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions .github/workflows/dump-refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ jobs:
if-no-files-found: ignore

- name: Create dump-refresh PR
id: cpr
if: env.TECHAPI_WRITE_TOKEN != ''
# A dump PR touches so many pages that GitHub may answer "diff is taking
# too long to generate" after the PR exists; the next step decides.
continue-on-error: true
uses: peter-evans/create-pull-request@v6
with:
path: ./techapi
Expand All @@ -101,3 +105,16 @@ jobs:
committer: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
author: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
delete-branch: true

- name: Confirm dump-refresh PR exists
if: steps.cpr.outcome == 'failure'
env:
GH_TOKEN: ${{ env.TECHAPI_WRITE_TOKEN }}
BRANCH: dump-refresh/${{ steps.meta.outputs.date }}
run: |
n=$(gh api "repos/GetTechAPI/TechAPI/pulls?head=GetTechAPI:${BRANCH}&state=open" -q '.[0].number')
if [ -z "$n" ]; then
echo "::error::create-pull-request failed and no open PR exists for ${BRANCH}"
exit 1
fi
echo "::warning::PR #${n} exists; the failure was GitHub's diff timeout on a large PR"
7 changes: 6 additions & 1 deletion .github/workflows/refresh-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ jobs:
TECHAPI_DATA_DIR: ${{ github.workspace }}/TechAPI/data
run: python -m app.dump

# ~1M small files crash upload-artifact ("Maximum call stack size
# exceeded"); ship the dump as one archive instead.
- name: Pack static dump
run: tar -czf techapi-static-dump.tgz dump

- name: Upload static dump artifact
uses: actions/upload-artifact@v4
with:
name: techapi-static-dump
path: dump/
path: techapi-static-dump.tgz

# To serve a public static API, enable Pages and swap the step above for:
# - uses: actions/upload-pages-artifact@v3
Expand Down
Loading