diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50b68b9..778f18c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,6 +162,24 @@ jobs: /cubbyhole/test foo ; /cubbyhole/test zip | NAMED_CUBBYSECRET ; + # The ordering of these two Test Vault Action Overwrites Env Vars In Subsequent Action steps matters + # They should come before the Verify Vault Action Outputs step + - name: Test Vault Action Overwrites Env Vars In Subsequent Action (part 1/2) + uses: ./ + with: + url: http://localhost:8200/ + token: testtoken + secrets: | + secret/data/test secret | SUBSEQUENT_TEST_SECRET; + + - name: Test Vault Action Overwrites Env Vars In Subsequent Action (part 2/2) + uses: ./ + with: + url: http://localhost:8200/ + token: testtoken + secrets: | + secret/data/subsequent-test secret | SUBSEQUENT_TEST_SECRET; + - name: Verify Vault Action Outputs run: npm run test:integration:e2e env: diff --git a/.gitignore b/.gitignore index ad46b30..c4297e6 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ typings/ # next.js build output .next + +# GoLand IDE project files +.idea diff --git a/integrationTests/e2e/e2e.test.js b/integrationTests/e2e/e2e.test.js index c5ed5af..6495d14 100644 --- a/integrationTests/e2e/e2e.test.js +++ b/integrationTests/e2e/e2e.test.js @@ -9,5 +9,6 @@ describe('e2e', () => { expect(process.env.OTHERALTSECRET).toBe("OTHERCUSTOMSECRET"); expect(process.env.FOO).toBe("bar"); expect(process.env.NAMED_CUBBYSECRET).toBe("zap"); + expect(process.env.SUBSEQUENT_TEST_SECRET).toBe("SUBSEQUENT_TEST_SECRET"); }); }); diff --git a/integrationTests/e2e/setup.js b/integrationTests/e2e/setup.js index 846a9ed..96f2295 100644 --- a/integrationTests/e2e/setup.js +++ b/integrationTests/e2e/setup.js @@ -76,6 +76,18 @@ const vaultToken = `${process.env.VAULT_TOKEN}` === undefined ? `${process.env.V zip: 'zap', }, }); + + await got(`http://${vaultUrl}/v1/secret/data/subsequent-test`, { + method: 'POST', + headers: { + 'X-Vault-Token': vaultToken, + }, + json: { + data: { + secret: 'SUBSEQUENT_TEST_SECRET', + }, + }, + }); } catch (error) { console.log(error); process.exit(1);