Skip to content

Commit

Permalink
set outputs to pass secrets to the next step
Browse files Browse the repository at this point in the history
  • Loading branch information
izaim authored Mar 28, 2024
1 parent 947c2a7 commit 558e5c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test_coverage_with_tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:

run: |
OUTPUT=$(aws cognito-idp "${{ secrets.COGNITO_INIT }}" --user-pool-id "${{ secrets.COGNITO_USER_POOL_ID }}" --client-id "${{ secrets.COGNITO_CLIENT_ID }}" --auth-flow "${{ secrets.COGNITO_AUTH_FLOW }}" --auth-parameters USERNAME="${{ secrets.COGNITO_USERNAME }}",PASSWORD=${{ secrets.COGNITO_PASSWORD }})
ACCESS_TOKEN=$(echo "$OUTPUT" | jq -r '.AuthenticationResult.AccessToken' | sed 's/^"\(.*\)"$/\1/')
ID_TOKEN=$(echo "$OUTPUT" | jq -r '.AuthenticationResult.IdToken' | sed 's/^"\(.*\)"$/\1/')
echo ACCESS_TOKEN=$(echo "$OUTPUT" | jq -r '.AuthenticationResult.AccessToken' | sed 's/^"\(.*\)"$/\1/') >> "$GITHUB_OUTPUT"
echo ID_TOKEN=$(echo "$OUTPUT" | jq -r '.AuthenticationResult.IdToken' | sed 's/^"\(.*\)"$/\1/') >> "$GITHUB_OUTPUT"
- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -54,8 +54,6 @@ jobs:

- name: Install CRIPT Python SDK
run: |
pwd
ls -la
pip install -e .
- name: Install requirements_dev.txt
Expand All @@ -64,6 +62,8 @@ jobs:
- name: Test Coverage
run: pytest tests/api/test_api.py
env:
ACCESS_TOKEN: ${{ steps.cognito-token.outputs.ACCESS_TOKEN }}
ID_TOKEN: ${{ steps.cognito-token.outputs.ID_TOKEN }}
CRIPT_HOST: https://lb-stage.mycriptapp.org/
CRIPT_TOKEN: $ID_TOKEN
CRIPT_STORAGE_TOKEN: $ACCESS_TOKEN
Expand Down

0 comments on commit 558e5c8

Please sign in to comment.