Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions .github/workflows/auth-react-test-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
outputs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
webJsInterfaceVersion: ${{ steps.versions.outputs.webJsInterfaceVersion }}

authReactFdiVersionMap: ${{ steps.auth-react-versions.outputs.fdiVersions }}
authReactWjiVersionMap: ${{ steps.auth-react-versions.outputs.webJsInterfaceVersions }}

nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }}

steps:
- uses: actions/checkout@v4

Expand All @@ -31,6 +37,21 @@ jobs:
has-fdi: true
has-web-js: true

- uses: supertokens/actions/get-versions-from-repo@main
id: auth-react-versions
with:
repo: supertokens-auth-react
github-token: ${{ secrets.GITHUB_TOKEN }}
fdi-versions: ${{ steps.versions.outputs.fdiVersions }}
wji-versions: '[${{ steps.versions.outputs.webJsInterfaceVersion }}]'

- uses: supertokens/actions/get-versions-from-repo@main
id: node-versions
with:
repo: supertokens-node
github-token: ${{ secrets.GITHUB_TOKEN }}
fdi-versions: ${{ steps.versions.outputs.fdiVersions }}

setup-auth-react:
runs-on: ubuntu-latest
needs: define-versions
Expand Down Expand Up @@ -58,21 +79,21 @@ jobs:
with:
node-version: 20

- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
fdi-version: ${{ matrix.fdi-version }}
fetch-frontend-versions: false
web-js-interface-version: ${{ needs.define-versions.outputs.webJsInterfaceVersion }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
- id: repo-versions
run: |
authReactVersionFromFdi=$( echo '${{ needs.define-versions.outputs.authReactFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )
authReactVersionFromWji=$( echo '${{ needs.define-versions.outputs.authReactWjiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )
nodeVersion=$( echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )

echo "authReactVersionFromFdi=${authReactVersionFromFdi}" >> $GITHUB_OUTPUT
echo "authReactVersionFromWji=${authReactVersionFromWji}" >> $GITHUB_OUTPUT
echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT

- uses: supertokens/auth-react-testing-action/setup@main
id: envs
with:
auth-react-version: ${{ steps.versions.outputs.webJsReactVersionXy }}
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
auth-react-version: ${{ steps.repo-versions.outputs.authReactVersionFromFdi }}
node-sdk-version: ${{ steps.repo-versions.outputs.nodeVersion }}
fdi-version: ${{ matrix.fdi-version }}
use-common-app-and-test-server: "true"
persist-workspace: "false"
Expand All @@ -81,7 +102,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: supertokens/supertokens-node
ref: ${{ steps.versions.outputs.nodeTag }}
ref: ${{ steps.repo-versions.outputs.nodeVersion }}
path: supertokens-node

- name: Copy over required dependencies
Expand Down
28 changes: 11 additions & 17 deletions .github/workflows/auth-react-test-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,32 +82,26 @@ jobs:
has-cdi: true
working-directory: supertokens-node

- uses: supertokens/get-versions-action@main
id: versions
- uses: supertokens/actions/get-versions-from-repo@main
id: core-versions
with:
driver-name: node
fdi-version: ${{ inputs.fdi-version }}
repo: supertokens-core
github-token: ${{ secrets.GITHUB_TOKEN }}
cdi-versions: ${{ steps.node-cdi-versions.outputs.cdiVersions }}

- name: Get last Node CDI version
id: last-node-cdi-version
- name: Get core version from latest Node CDI version
id: core-version
run: |
export lastVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]')
echo "lastNodeCdiVersion=$lastVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]') | sed -e 's/"/\\"/g'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pipe (|) is misplaced in this command. It should be part of the command substitution rather than after the assignment. Currently, sed will receive empty input instead of processing the lastNodeCdiVersion value.

Correct syntax:

lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]' | sed -e 's/"/\\"/g')

This ensures the sed command properly escapes quotes in the CDI version string.

Suggested change
lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]') | sed -e 's/"/\\"/g'
lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]' | sed -e 's/"/\\"/g')

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

coreVersion=$(echo '${{ steps.core-versions.outputs.cdiVersions }}' | jq -r ".[$lastNodeCdiVersion]")

- name: Get Core version
id: core-version
uses: supertokens/get-versions-action@main
with:
driver-name: node
cdi-version: ${{ steps.last-node-cdi-version.outputs.lastNodeCdiVersion }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
echo "coreVersion=${coreVersion}" >> $GITHUB_OUTPUT

- name: Start core
run: docker compose up --wait
working-directory: supertokens-web-js
env:
SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersionXy }}
SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersion }}

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