declared env value
This commit is contained in:
@@ -15,6 +15,11 @@ jobs:
|
|||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
architecture: [x64, arm64]
|
architecture: [x64, arm64]
|
||||||
|
|
||||||
|
env:
|
||||||
|
SHUFFLE_DEFAULT_USERNAME: demo@demo.io
|
||||||
|
SHUFFLE_DEFAULT_PASSWORD: supercoolpassword
|
||||||
|
SHUFFLE_DEFAULT_APIKEY: supercoolapikey
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -72,10 +77,13 @@ jobs:
|
|||||||
- name: Get the API key and run a health check
|
- name: Get the API key and run a health check
|
||||||
id: health_check
|
id: health_check
|
||||||
run: |
|
run: |
|
||||||
RESPONSE=$(curl -s -k -u admin:StrongShufflePassword321! 'https://localhost:9200/users/_search')
|
RESPONSE=$(curl -s -k -u "$SHUFFLE_DEFAULT_USERNAME:$SHUFFLE_DEFAULT_PASSWORD" 'https://localhost:9200/users/_search')
|
||||||
|
echo "Raw Response: $RESPONSE"
|
||||||
|
|
||||||
API_KEY=$(echo "$RESPONSE" | jq -r '.hits.hits[0]._source.apikey')
|
API_KEY=$(echo "$RESPONSE" | jq -r '.hits.hits[0]._source.apikey')
|
||||||
if [ -n "$API_KEY" ]; then
|
if [ -n "$API_KEY" ] && [ "$API_KEY" != "null" ]; then
|
||||||
echo "Admin API key: $API_KEY"
|
echo "Admin API key: $API_KEY"
|
||||||
|
echo "API_KEY=$API_KEY" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "Failed to retrieve the API key for the admin user."
|
echo "Failed to retrieve the API key for the admin user."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user