Skip to content

Commit e0c1424

Browse files
committed
update: use new get-versions-from-repo action in auth-react
1 parent da7e0d6 commit e0c1424

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed

.github/workflows/auth-react-test-1.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,22 @@ jobs:
2121
runs-on: ubuntu-latest
2222
outputs:
2323
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
24+
25+
nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }}
2426
steps:
2527
- uses: actions/checkout@v4
2628
- uses: supertokens/get-supported-versions-action@main
2729
id: versions
2830
with:
2931
has-fdi: true
3032

33+
- uses: supertokens/actions/get-versions-from-repo@main
34+
id: node-versions
35+
with:
36+
repo: supertokens-node
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
fdi-versions: ${{ steps.versions.outputs.fdiVersions }}
39+
3140
setup-auth-react:
3241
runs-on: ubuntu-latest
3342
needs: define-versions
@@ -45,21 +54,26 @@ jobs:
4554
AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
4655
specs: ${{ steps.envs.outputs.specs }}
4756
fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }}
57+
nodeFdiVersionMap: ${{ needs.define-versions.outputs.nodeFdiVersionMap }}
4858

4959
steps:
50-
- uses: supertokens/get-versions-action@main
51-
id: versions
60+
- id: repo-versions
61+
run: |
62+
nodeVersion=$( echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )
63+
echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT
64+
65+
# We will use this in the test run to get the core version
66+
- uses: actions/checkout@v4
5267
with:
53-
driver-name: node
54-
fdi-version: ${{ matrix.fdi-version }}
55-
env:
56-
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
68+
repository: supertokens/supertokens-node
69+
ref: ${{ steps.repo-versions.outputs.nodeVersion }}
70+
path: supertokens-node
5771

5872
- uses: supertokens/auth-react-testing-action/setup@main
5973
id: envs
6074
with:
6175
auth-react-version: ${{ github.sha }}
62-
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
76+
node-sdk-version: ${{ steps.repo-versions.outputs.nodeVersion }}
6377
fdi-version: ${{ matrix.fdi-version }}
6478
use-common-app-and-test-server: "true"
6579

.github/workflows/auth-react-test-2.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,33 @@ jobs:
6969
with:
7070
path: supertokens-auth-react
7171

72+
- name: Get Node CDI versions
73+
id: node-cdi-versions
74+
uses: supertokens/get-supported-versions-action@main
75+
with:
76+
has-cdi: true
77+
working-directory: supertokens-node
78+
79+
- uses: supertokens/actions/get-versions-from-repo@main
80+
id: core-versions
81+
with:
82+
repo: supertokens-core
83+
github-token: ${{ secrets.GITHUB_TOKEN }}
84+
cdi-versions: ${{ steps.node-cdi-versions.outputs.cdiVersions }}
85+
86+
- name: Get core version from latest Node CDI version
87+
id: core-version
88+
run: |
89+
lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]') | sed -e 's/"/\\"/g'
90+
coreVersion=$(echo '${{ steps.core-versions.outputs.cdiVersions }}' | jq -r ".[$lastNodeCdiVersion]")
91+
92+
echo "coreVersion=${coreVersion}" >> $GITHUB_OUTPUT
93+
7294
- name: Start core
7395
run: docker compose up --wait
74-
working-directory: supertokens-auth-react
96+
working-directory: supertokens-web-js
97+
env:
98+
SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersion }}
7599

76100
- uses: supertokens/auth-react-testing-action@main
77101
name: test ${{ matrix.spec }} for ${{ inputs.fdi-version }}

0 commit comments

Comments
 (0)