diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a45c500..4e4b8ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,10 +20,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' cache: 'npm' @@ -35,10 +35,10 @@ jobs: run: npm run build - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0 - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: ./out @@ -51,4 +51,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/.github/workflows/promote-sandbox-to-main.yml b/.github/workflows/promote-sandbox-to-main.yml index 9a7dab9..0652684 100644 --- a/.github/workflows/promote-sandbox-to-main.yml +++ b/.github/workflows/promote-sandbox-to-main.yml @@ -42,13 +42,13 @@ jobs: ahead-count: ${{ steps.diff.outputs.ahead-count }} steps: - name: Checkout sandbox - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: ref: sandbox fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "20" cache: "npm" @@ -73,8 +73,10 @@ jobs: echo "ahead-count=$AHEAD" >> "$GITHUB_OUTPUT" - name: Record lint outcome + env: + LINT_OUTCOME: ${{ steps.lint.outcome }} run: | - echo "Lint step outcome: ${{ steps.lint.outcome }}" + echo "Lint step outcome: $LINT_OUTCOME" # Runs only when a previous required step (checkout/install/build) failed. - name: Report build failure @@ -103,12 +105,14 @@ jobs: # Runs when the build succeeds, to auto-resolve a previously filed failure issue. - name: Close stale build-failure issue if now fixed if: success() + env: + VALIDATED_SHA: ${{ github.sha }} run: | EXISTING=$(gh issue list --state open --json number,title \ --jq ".[] | select(.title == \"$BUILD_FAILURE_ISSUE_TITLE\") | .number" | head -n1) if [ -n "$EXISTING" ]; then - gh issue comment "$EXISTING" --body "Build passed again at \`${{ github.sha }}\`. Closing." + gh issue comment "$EXISTING" --body "Build passed again at \`$VALIDATED_SHA\`. Closing." gh issue close "$EXISTING" fi @@ -121,7 +125,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 @@ -251,11 +255,13 @@ jobs: # Runs when PR create/update succeeds, to auto-resolve a previously filed failure issue. - name: Close stale promotion-failure issue if now fixed if: steps.promote_pr.outcome == 'success' + env: + VALIDATED_SHA: ${{ github.sha }} run: | EXISTING=$(gh issue list --state open --json number,title \ --jq ".[] | select(.title == \"$PR_FAILURE_ISSUE_TITLE\") | .number" | head -n1) if [ -n "$EXISTING" ]; then - gh issue comment "$EXISTING" --body "Promotion PR created/updated successfully at \`${{ github.sha }}\`. Closing." + gh issue comment "$EXISTING" --body "Promotion PR created/updated successfully at \`$VALIDATED_SHA\`. Closing." gh issue close "$EXISTING" fi diff --git a/app/layout.tsx b/app/layout.tsx index 471a246..7d75af5 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -44,6 +44,34 @@ export const metadata: Metadata = { }, } +// This site is statically exported to GitHub Pages, which does not support +// setting custom HTTP response headers (no server, no _headers file). A CSP +// delivered via is the only mechanism available in this +// environment - it can't enforce frame-ancestors, X-Frame-Options, +// Strict-Transport-Security, or Permissions-Policy (those require a real +// HTTP header and a hosting layer that can send one), but it does restrict +// which origins scripts, styles, images, fonts, and connections can load +// from, which is the main defense-in-depth value here. +// +// script-src includes 'unsafe-inline' because Next.js's static export embeds +// its RSC hydration payload as inline