Skip to content

Commit 005b1e6

Browse files
authored
Stop relying on githack URLs (#4956)
This replaces all githack URLs, relied upon by our GitHub Actions and Netlify processes, with raw.githubusercontent.com URLs. It seems that githack may have recently implemented an extra confirmation step before rendering documents; it's framed as end-user protection, but I have to imagine it might help alleviate load for them from bots as well. spec-generator already has additional logic specifically to support raw.githubusercontent.com URLs when used with ReSpec, so switching these does not present a problem. I tested each replaced URL locally. (`/refs/heads/` is only included when referencing a branch, not a specific commit.)
1 parent b6232e8 commit 005b1e6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.github/workflows/11ty-publish.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ jobs:
3232
npm i
3333
npm run build
3434
cp guidelines/guidelines.css guidelines/relative-luminance.html _site/guidelines/22
35-
curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githack.com/$GITHUB_REPOSITORY/main/guidelines/index.html -o _site/guidelines/22/index.html -f --retry 3
36-
curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githack.com/$GITHUB_REPOSITORY/main/requirements/22/index.html -o _site/requirements/22/index.html -f --retry 3
37-
curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githack.com/$GITHUB_REPOSITORY/main/conformance-challenges/index.html -o _site/conformance-challenges/index.html -f --retry 3
35+
curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githubusercontent.com/$GITHUB_REPOSITORY/refs/heads/main/guidelines/index.html -o _site/guidelines/22/index.html -f --retry 3
36+
curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githubusercontent.com/$GITHUB_REPOSITORY/refs/heads/main/requirements/22/index.html -o _site/requirements/22/index.html -f --retry 3
3837
- name: Push
3938
uses: stefanzweifel/git-auto-commit-action@v5
4039
with:

eleventy.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default async function (eleventyConfig: any) {
236236
join(dir.output, "guidelines", "relative-luminance.html")
237237
);
238238

239-
const url = `https://raw.githack.com/${GH_ORG}/${GH_REPO}/${sha}/guidelines/index.html?isPreview=true`;
239+
const url = `https://raw.githubusercontent.com/${GH_ORG}/${GH_REPO}/${sha}/guidelines/index.html?isPreview=true`;
240240
const processedGuidelines = await fetchText(
241241
`https://www.w3.org/publications/spec-generator/?type=respec&url=${encodeURIComponent(url)}`
242242
);

0 commit comments

Comments
 (0)