File tree Expand file tree Collapse file tree
samples/react/login-pkce/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 workflow_dispatch :
1212
1313permissions :
14- contents : write
14+ contents : read
1515
1616jobs :
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"
Original file line number Diff line number Diff line change 1+ import React from "react" ;
12import { render , screen } from "@testing-library/react" ;
23import { expect , test , vi } from "vitest" ;
4+ import App from "./App" ;
35
46const mockUseAuth = vi . fn ( ) ;
57
@@ -10,8 +12,6 @@ vi.mock("react-oidc-context", () => ({
1012 useAuth : ( ) => mockUseAuth ( ) ,
1113} ) ) ;
1214
13- import App from "./App" ;
14-
1515test ( "renders sign in button when not authenticated" , ( ) => {
1616 mockUseAuth . mockReturnValue ( {
1717 isLoading : false ,
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments