diff --git a/.github/workflows/release-acceptance.yml b/.github/workflows/release-acceptance.yml index 3babb13ff7..5a293dee32 100644 --- a/.github/workflows/release-acceptance.yml +++ b/.github/workflows/release-acceptance.yml @@ -29,21 +29,24 @@ jobs: egress-policy: audit - name: Authenticate + env: + HEDERA_PORTAL_USER: ${{ secrets.HEDERA_PORTAL_USER }} + HEDERA_PORTAL_PASSWORD: ${{ secrets.HEDERA_PORTAL_PASSWORD }} run: | - RESPONSE=$(jq --null-input -r --arg USER "${{ secrets.HEDERA_PORTAL_USER }}" --arg PASS "${{ secrets.HEDERA_PORTAL_PASSWORD }}" '{"email": $USER, "password": $PASS}' | curl -sSL -c /tmp/cookiejar.bin --data @- -X POST -H "Accept: application/json" -H "Content-Type: application/json" https://portal.hedera.com/api/session) - echo "::add-mask::$RESPONSE" - echo "The response was: $RESPONSE" - ACCOUNTS_JSON="$(curl -sSL -b /tmp/cookiejar.bin -H "Accept: application/json" https://portal.hedera.com/api/account)" - echo "::add-mask::$ACCOUNTS_JSON" - TESTNET_ACCOUNT=$(echo $ACCOUNTS_JSON | jq -r '.accounts[] | select(.network=="testnet") | .accountNum') - echo "The testnet account is: $TESTNET_ACCOUNT" - PUBLIC_KEY=$(echo $ACCOUNTS_JSON | jq -r '.accounts[] | select(.network=="testnet") | .publicKey') - echo "The publicKey is: $PUBLIC_KEY" - PRIVATE_KEY=$(echo $ACCOUNTS_JSON | jq -r '.accounts[] | select(.network=="testnet") | .privateKey') - echo "::add-mask::$PRIVATE_KEY" - echo "The privateKey is: $PRIVATE_KEY" - echo "OPERATOR_ID_MAIN=0.0.${TESTNET_ACCOUNT}" >> $GITHUB_ENV - echo "OPERATOR_KEY_MAIN=${PRIVATE_KEY}" >> $GITHUB_ENV + RESPONSE=$(jq --null-input -r --arg USER "${HEDERA_PORTAL_USER}" --arg PASS "${HEDERA_PORTAL_PASSWORD}" '{"email": $USER, "password": $PASS}' | curl -sSL -c /tmp/cookiejar.bin --data @- -X POST -H "Accept: application/json" -H "Content-Type: application/json" https://portal.hedera.com/api/session) + echo "::add-mask::$RESPONSE" + echo "The response was: $RESPONSE" + ACCOUNTS_JSON="$(curl -sSL -b /tmp/cookiejar.bin -H "Accept: application/json" https://portal.hedera.com/api/account)" + echo "::add-mask::$ACCOUNTS_JSON" + TESTNET_ACCOUNT=$(echo $ACCOUNTS_JSON | jq -r '.accounts[] | select(.network=="testnet") | .accountNum') + echo "The testnet account is: $TESTNET_ACCOUNT" + PUBLIC_KEY=$(echo $ACCOUNTS_JSON | jq -r '.accounts[] | select(.network=="testnet") | .publicKey') + echo "The publicKey is: $PUBLIC_KEY" + PRIVATE_KEY=$(echo $ACCOUNTS_JSON | jq -r '.accounts[] | select(.network=="testnet") | .privateKey') + echo "::add-mask::$PRIVATE_KEY" + echo "The privateKey is: $PRIVATE_KEY" + echo "OPERATOR_ID_MAIN=0.0.${TESTNET_ACCOUNT}" >> $GITHUB_ENV + echo "OPERATOR_KEY_MAIN=${PRIVATE_KEY}" >> $GITHUB_ENV - name: Setup node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2