diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7f88a2..ff1f9f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,9 +29,9 @@ jobs: services: vault: - image: vault + image: vault:1.2.3 ports: - - 8200:8200 + - 8200/tcp env: VAULT_DEV_ROOT_TOKEN_ID: testtoken options: --cap-add=IPC_LOCK @@ -43,3 +43,7 @@ jobs: - name: test connection run: node quicktest.js + env: + VAULT_HOST: localhost + VAULT_PORT: ${{ job.services.vault.ports[8200] }} + diff --git a/quicktest.js b/quicktest.js index 1b7979a..360aa02 100644 --- a/quicktest.js +++ b/quicktest.js @@ -1,7 +1,7 @@ const got = require('got'); (async () => { - const result = await got(`localhost:8200/v1/secret/config`, { + const result = await got(`${process.env.VAULT_HOST}:${process.env.VAULT_PORT}/v1/secret/config`, { method: 'POST', headers: { 'X-Vault-Token': 'testtoken'