Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11cea53dab | ||
|
|
35e8b60684 | ||
|
|
da7a01a1c1 | ||
|
|
dbf2d342a7 |
No files matched your search
@@ -0,0 +1,42 @@
|
||||
# Node.js CI for news-platform bridge
|
||||
# Runs on: PR and push to main/develop
|
||||
# Checks: TypeScript build and type checking
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
env:
|
||||
CI: "true"
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18, 20]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: bridge
|
||||
|
||||
- name: TypeScript build
|
||||
run: npm run build
|
||||
working-directory: bridge
|
||||
if: always()
|
||||
|
||||
- name: TypeScript type checking
|
||||
run: npm run typecheck
|
||||
working-directory: bridge
|
||||
if: always()
|
||||
@@ -53,4 +53,13 @@ _c="$(code_for "$BASE_URL/wp-json/wp/v2/")"
|
||||
[[ "$_c" == "200" ]] || fail "GET $BASE_URL/wp-json/wp/v2/ expected 200, got $_c (WP andebol :8081)"
|
||||
ok "GET /wp-json/wp/v2/ → $_c"
|
||||
|
||||
# Auth redirects — /entrar and /registar must NOT land on / (BIT-22298)
|
||||
_final_entrar="$(curl -fsS -o /dev/null -w '%{url_effective}' --max-time 25 -L -H "Host: $HOST_HEADER" "$BASE_URL/entrar" 2>/dev/null || true)"
|
||||
[[ "$_final_entrar" == *"wp-login"* ]] || fail "/entrar final URL must contain wp-login; got: $_final_entrar"
|
||||
ok "GET /entrar → $_final_entrar"
|
||||
|
||||
_final_registar="$(curl -fsS -o /dev/null -w '%{url_effective}' --max-time 25 -L -H "Host: $HOST_HEADER" "$BASE_URL/registar" 2>/dev/null || true)"
|
||||
[[ "$_final_registar" == *"wp-login"* ]] || fail "/registar final URL must contain wp-login; got: $_final_registar"
|
||||
ok "GET /registar → $_final_registar"
|
||||
|
||||
echo "All smokes passed for BASE_URL=$BASE_URL (host: $HOST_HEADER)"
|
||||
@@ -2,8 +2,9 @@
|
||||
import { getDomainConfig } from '../lib/domain.js';
|
||||
|
||||
const config = getDomainConfig(Astro.url.hostname);
|
||||
if (!config.auth_links) {
|
||||
if (config.auth_links === false) {
|
||||
return Astro.redirect('/', 302);
|
||||
}
|
||||
Astro.response.headers.set('Cache-Control', 'no-store');
|
||||
return Astro.redirect('/wp-login.php', 302);
|
||||
---
|
||||
@@ -2,8 +2,9 @@
|
||||
import { getDomainConfig } from '../lib/domain.js';
|
||||
|
||||
const config = getDomainConfig(Astro.url.hostname);
|
||||
if (!config.auth_links) {
|
||||
if (config.auth_links === false) {
|
||||
return Astro.redirect('/', 302);
|
||||
}
|
||||
Astro.response.headers.set('Cache-Control', 'no-store');
|
||||
return Astro.redirect('/wp-login.php?action=register', 302);
|
||||
---
|
||||
Reference in new issue
Block a user