Skip to content

Commit

Permalink
Update integration tests to fetch bearer token
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Wenger committed Feb 21, 2024
1 parent 2af68b4 commit d0a40bc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@ jobs:
with:
ruby-version: 2.6.x

- name: Retrieve bearer token
id: get_bearer_token
run: |
response=$(curl -X POST ${{secrets.OKTA_ACCESS_TOKEN_URL}}/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=${{secrets.OKTA_CLIENT_ID}}&client_secret=${{secrets.OKTA_CLIENT_SECRET}}")
token=$(echo $response | jq -r '.access_token')
echo "BEARER_TOKEN=${token}" >> $GITHUB_ENV
- name: Build & test
run: |
gem install bundler:2.3.6
bundle config set --local path 'vendor/bundle'
bundle install
API_USERNAME='${{ secrets.API_USERNAME }}' API_PASSWORD='${{ secrets.API_PASSWORD }}' bundle exec rspec
bundle exec rspec
env:
BEARER_TOKEN: ${{ env.BEARER_TOKEN }}

0 comments on commit d0a40bc

Please sign in to comment.