Skip to content

Commit f5e46d2

Browse files
committed
TO-DROP: investigate "secondary rate limit" problem
In https://github.com/git/git-scm.com/actions/runs/10818898105/job/30015545237#step:3:125466 as well as in https://github.com/git/git-scm.com/actions/runs/10819147877/job/30016365271#step:3:125438 I hit the following snag: RequestError [HttpError]: You have exceeded a secondary rate limit. Please wait a few minutes before you try again. [...] First of all, let's try to trigger this reliably, then work around it. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent ff25925 commit f5e46d2

File tree

1 file changed

+4
-95
lines changed

1 file changed

+4
-95
lines changed

.github/actions/deploy-to-github-pages/action.yml

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -14,92 +14,14 @@ inputs:
1414
description: The GitHub token used to create an authenticated client
1515
default: ${{ github.token }}
1616
required: true
17-
outputs:
18-
url:
19-
description: The URL to which the site was deployed
20-
value: ${{ steps.deploy.outputs.page_url }}
2117
runs:
2218
using: "composite"
2319
steps:
24-
- name: push changes (if needed)
20+
- name: Fake lychee run
2521
shell: bash
2622
run: |
27-
test "$(git rev-parse HEAD)" = "$(git rev-parse refs/remotes/origin/${{ github.ref_name }})" ||
28-
git push origin HEAD:${{ github.ref }}
29-
30-
- name: un-sparse worktree to prepare for deployment
31-
shell: bash
32-
run: git sparse-checkout disable
33-
34-
- name: setup GitHub Pages
35-
id: pages
36-
uses: actions/configure-pages@v5
37-
38-
- name: configure Hugo and Pagefind version
39-
shell: bash
40-
run: |
41-
set -x &&
42-
echo "HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml)" >>$GITHUB_ENV
43-
echo "PAGEFIND_VERSION=$(sed -n 's/^ *pagefind_version: *//p' <hugo.yml)" >>$GITHUB_ENV
44-
45-
- name: install Hugo ${{ env.HUGO_VERSION }}
46-
shell: bash
47-
run: |
48-
set -x &&
49-
curl -Lo /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
50-
sudo dpkg -i /tmp/hugo.deb
51-
52-
- name: run Hugo to build the pages
53-
env:
54-
HUGO_RELATIVEURLS: false
55-
shell: bash
56-
run: hugo config && hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
57-
58-
- name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index
59-
shell: bash
60-
run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public
61-
62-
- name: upload GitHub Pages artifact
63-
uses: actions/upload-pages-artifact@v3
64-
with:
65-
path: ./public
66-
67-
- name: deploy
68-
id: deploy
69-
uses: actions/deploy-pages@v4
70-
71-
- name: construct `--remap` option for lychee
72-
id: remap
73-
shell: bash
74-
run: |
75-
base_url='${{ steps.pages.outputs.base_url }}'
76-
echo "result=$(echo "$base_url" |
77-
sed 's|^\(.*\)\(/git-scm\.com\)$|(\1)?\2(.*)|') file://$PWD/public\$2" \
78-
>>$GITHUB_OUTPUT
79-
80-
- name: check for broken links
81-
id: lychee
82-
uses: lycheeverse/lychee-action@d4128702eae98bbc5ecf74df0165a8156c80920a # until an official version is out that includes https://github.com/lycheeverse/lychee/pull/1422
83-
with:
84-
lycheeVersion: nightly # until an official version includes https://github.com/lycheeverse/lychee/pull/1422
85-
args: >-
86-
--offline
87-
--fallback-extensions html
88-
--base '${{ steps.pages.outputs.base_url }}'
89-
--remap '${{ steps.remap.outputs.result }}'
90-
--exclude file:///path/to/repo.git/
91-
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/
92-
--exclude file:///ruta/a/repositorio.git/
93-
--exclude file:///sl%C3%B3%C3%B0/til/hirsla.git/
94-
--exclude file:///Pfad/zum/Repo.git/
95-
--exclude file:///chemin/du/d%C3%A9p%C3%B4t.git/
96-
--exclude file:///srv/git/project.git
97-
public/
98-
output: lychee.md
99-
jobSummary: true
100-
fail: false
101-
failIfEmpty: false # needed because its default overrides `fail = false`
102-
23+
echo 'lychee_exit_code=0' >>$GITHUB_ENV
24+
echo 'O hai' >lychee.md
10325
- name: ${{ env.lychee_exit_code != '0' && 'maybe close' || 'open or update' }} link checker issue
10426
uses: actions/github-script@v7
10527
with:
@@ -116,6 +38,7 @@ runs:
11638
const req = { owner: context.repo.owner, repo: context.repo.repo }
11739
const q = `"Link+Checker+Report"+in:title+is:issue+label:linkchecker+is:open+repo:${req.owner}/${req.repo}`
11840
try {
41+
if (process.env) throw new Error('force fall back')
11942
return await github.rest.search.issuesAndPullRequests({ ...req, q, sort: 'created', per_page: 1 })
12043
} catch (e) {
12144
// sleep for 30 seconds
@@ -141,17 +64,3 @@ runs:
14164
await github.rest.issues.update({ ...req, state: 'closed' })
14265
}
14366
}
144-
145-
- name: Install @playwright/test
146-
shell: bash
147-
run: npm install @playwright/test
148-
- name: Run Playwright tests
149-
shell: bash
150-
env:
151-
PLAYWRIGHT_TEST_URL: ${{ steps.pages.outputs.base_url }}
152-
run: npx playwright test --project=chrome
153-
- uses: actions/upload-artifact@v4
154-
if: always()
155-
with:
156-
name: playwright-report
157-
path: playwright-report/

0 commit comments

Comments
 (0)