mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
fix(ci): resolve blog-SEO base ref to a SHA in merge queue (#3137)
Some checks failed
visual-baseline / Capture visual baselines (push) Waiting to run
actionlint / Lint GitHub Actions workflows (push) Failing after 1s
ci / Detect CI change scopes (push) Successful in 0s
landing-page-ci / Validate landing page (push) Failing after 1s
landing-page-staging / Deploy landing page to staging (push) Has been skipped
nix-check / build (push) Failing after 2s
ci / Validate Nix flake (push) Has been skipped
ci / Preflight (push) Failing after 2s
ci / Workspace unit tests (push) Failing after 2s
ci / Daemon workspace tests (push) Failing after 2s
ci / Web workspace tests (push) Failing after 1s
ci / Browser tests (push) Failing after 1s
ci / Build workspaces (push) Failing after 1s
ci / Validate workspace (push) Failing after 0s
ci / Runtime trace (push) Has been skipped
Some checks failed
visual-baseline / Capture visual baselines (push) Waiting to run
actionlint / Lint GitHub Actions workflows (push) Failing after 1s
ci / Detect CI change scopes (push) Successful in 0s
landing-page-ci / Validate landing page (push) Failing after 1s
landing-page-staging / Deploy landing page to staging (push) Has been skipped
nix-check / build (push) Failing after 2s
ci / Validate Nix flake (push) Has been skipped
ci / Preflight (push) Failing after 2s
ci / Workspace unit tests (push) Failing after 2s
ci / Daemon workspace tests (push) Failing after 2s
ci / Web workspace tests (push) Failing after 1s
ci / Browser tests (push) Failing after 1s
ci / Build workspaces (push) Failing after 1s
ci / Validate workspace (push) Failing after 0s
ci / Runtime trace (push) Has been skipped
The "Lint changed blog SEO" and "Guard blog URL changes" steps in landing-page-ci.yml fell back to the literal "HEAD^" when no base SHA was available. On merge_group (and first-push) events there is no pull_request.base.sha / before, so BASE became "HEAD^", and the blog-indexing scripts' assertSafeGitRef (regex /^[A-Za-z0-9_./:-]+$/, which forbids "^") threw `Unsafe git ref for base: HEAD^`, failing the merge queue for every PR. Resolve the fallback to a concrete commit with `git rev-parse HEAD^` (checkout uses fetch-depth: 0, so it is always available), mirroring blog-indexing-on-deploy.yml. The resulting 40-hex SHA passes the ref guard.
This commit is contained in:
parent
ce9fa687ca
commit
abe72af2a2
1 changed files with 12 additions and 6 deletions
18
.github/workflows/landing-page-ci.yml
vendored
18
.github/workflows/landing-page-ci.yml
vendored
|
|
@ -123,9 +123,12 @@ jobs:
|
||||||
|
|
||||||
- name: Lint changed blog SEO
|
- name: Lint changed blog SEO
|
||||||
run: |
|
run: |
|
||||||
BASE="${{ github.event.pull_request.base.sha || github.event.before || 'HEAD^' }}"
|
BASE="${{ github.event.pull_request.base.sha || github.event.before || '' }}"
|
||||||
if [ "$BASE" = "0000000000000000000000000000000000000000" ]; then
|
if [ -z "$BASE" ] || [ "$BASE" = "0000000000000000000000000000000000000000" ]; then
|
||||||
BASE="HEAD^"
|
# merge_group (and first-push) events have no base SHA. Resolve a
|
||||||
|
# concrete commit instead of passing the literal "HEAD^", which the
|
||||||
|
# blog-indexing scripts' assertSafeGitRef rejects (no "^" allowed).
|
||||||
|
BASE="$(git rev-parse HEAD^)"
|
||||||
fi
|
fi
|
||||||
pnpm --filter @open-design/landing-page exec tsx scripts/blog-indexing/lint-blog-seo.ts \
|
pnpm --filter @open-design/landing-page exec tsx scripts/blog-indexing/lint-blog-seo.ts \
|
||||||
--base "$BASE" \
|
--base "$BASE" \
|
||||||
|
|
@ -134,9 +137,12 @@ jobs:
|
||||||
|
|
||||||
- name: Guard blog URL changes
|
- name: Guard blog URL changes
|
||||||
run: |
|
run: |
|
||||||
BASE="${{ github.event.pull_request.base.sha || github.event.before || 'HEAD^' }}"
|
BASE="${{ github.event.pull_request.base.sha || github.event.before || '' }}"
|
||||||
if [ "$BASE" = "0000000000000000000000000000000000000000" ]; then
|
if [ -z "$BASE" ] || [ "$BASE" = "0000000000000000000000000000000000000000" ]; then
|
||||||
BASE="HEAD^"
|
# merge_group (and first-push) events have no base SHA. Resolve a
|
||||||
|
# concrete commit instead of passing the literal "HEAD^", which the
|
||||||
|
# blog-indexing scripts' assertSafeGitRef rejects (no "^" allowed).
|
||||||
|
BASE="$(git rev-parse HEAD^)"
|
||||||
fi
|
fi
|
||||||
pnpm --filter @open-design/landing-page exec tsx scripts/blog-indexing/check-blog-url-changes.ts \
|
pnpm --filter @open-design/landing-page exec tsx scripts/blog-indexing/check-blog-url-changes.ts \
|
||||||
--base "$BASE" \
|
--base "$BASE" \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue