Skip to content

Commit 4d5bb4b

Browse files
committed
review fixes
1 parent 1177030 commit 4d5bb4b

3 files changed

Lines changed: 33 additions & 7 deletions

File tree

.github/workflows/extract.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ on:
1111
workflow_dispatch:
1212

1313
permissions:
14-
contents: write
14+
contents: read
1515

1616
jobs:
17-
extract:
17+
validate:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4
@@ -47,14 +47,40 @@ jobs:
4747
git diff --exit-code snippets.json snippet-manifest.yaml || \
4848
(echo "::error::Extracted artifacts are out of date. Run 'cd scripts && yarn all' and commit the results." && exit 1)
4949
50+
commit:
51+
needs: validate
52+
if: github.event_name == 'push'
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: write
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- uses: actions/setup-node@v4
60+
with:
61+
node-version: "22"
62+
63+
- name: Enable Corepack
64+
run: corepack enable
65+
66+
- name: Install dependencies
67+
run: yarn install --immutable
68+
69+
- name: Aggregate manifests
70+
working-directory: scripts
71+
run: yarn aggregate
72+
73+
- name: Extract snippets
74+
working-directory: scripts
75+
run: yarn extract
76+
5077
- name: Check for changes
5178
id: diff
52-
if: github.event_name == 'push'
5379
run: |
5480
git diff --quiet snippets.json snippet-manifest.yaml || echo "changed=true" >> "$GITHUB_OUTPUT"
5581
5682
- name: Commit updated artifacts
57-
if: github.event_name == 'push' && steps.diff.outputs.changed == 'true'
83+
if: steps.diff.outputs.changed == 'true'
5884
run: |
5985
git config user.name "github-actions[bot]"
6086
git config user.email "github-actions[bot]@users.noreply.github.com"

samples/react/login-pkce/src/App.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import React from "react";
12
import { render, screen } from "@testing-library/react";
23
import { expect, test, vi } from "vitest";
4+
import App from "./App";
35

46
const mockUseAuth = vi.fn();
57

@@ -10,8 +12,6 @@ vi.mock("react-oidc-context", () => ({
1012
useAuth: () => mockUseAuth(),
1113
}));
1214

13-
import App from "./App";
14-
1515
test("renders sign in button when not authenticated", () => {
1616
mockUseAuth.mockReturnValue({
1717
isLoading: false,

scripts/extract-snippets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function extractStepsFromFile(
127127
code,
128128
file: path.relative(scenarioDir, filePath),
129129
lang,
130-
lines: `${startLine + 1}-${i}`,
130+
lines: `${startLine}-${i}`,
131131
});
132132
currentStep = null;
133133
continue;

0 commit comments

Comments
 (0)