Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit 34cb73e

Browse files
committed
fixing an issue where environment variables were not inherited
1 parent 33643a8 commit 34cb73e

6 files changed

Lines changed: 99 additions & 81 deletions

File tree

.github/workflows/test.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55
paths:
66
- 'action/*'
77
- 'action.yaml'
8+
- '.github/workflows/test.yaml'
89
branches:
910
- main
1011
pull_request:
1112
paths:
1213
- 'action/*'
1314
- 'action.yaml'
15+
- '.github/workflows/test.yaml'
1416
workflow_dispatch:
1517

1618
defaults:
@@ -25,7 +27,7 @@ jobs:
2527
strategy:
2628
matrix:
2729
os: [macos-latest, windows-latest, ubuntu-latest]
28-
version: ['0.8.0', '0.9.2']
30+
version: ['0.9.2', 'latest']
2931
steps:
3032
- name: Checkout
3133
uses: actions/checkout@v4
@@ -35,6 +37,14 @@ jobs:
3537
with:
3638
version: ${{ matrix.version }}
3739

40+
- name: Get latest SLV Version
41+
id: slv-latest
42+
run: |
43+
echo "version=$(curl -s https://api.github.com/repos/amagioss/slv/releases/latest | jq -r .tag_name)" >> $GITHUB_OUTPUT
44+
45+
- name: Show SLV Version
46+
run: |
47+
echo "SLV Version: $(slv --version | grep "SLV Version")"
3848
- name: Capture SLV Version Installed
3949
run: |
4050
echo "SLV_VERSION_INSTALLED=$(slv --version | grep "SLV Version" | awk '{print $4}')" >> $GITHUB_ENV
@@ -43,11 +53,13 @@ jobs:
4353
shell: python
4454
env:
4555
SLV_VERSION_EXPECTED: ${{ matrix.version }}
56+
SLV_LATEST_VERSION: ${{ steps.slv-latest.outputs.version }}
4657
run: |
4758
import sys, os
48-
sys.exit(
49-
int(not os.environ["SLV_VERSION_EXPECTED"] in os.environ["SLV_VERSION_INSTALLED"])
50-
)
59+
if os.environ["SLV_VERSION_EXPECTED"] == "latest":
60+
sys.exit(0 if os.environ["SLV_VERSION_INSTALLED"] == os.environ["SLV_LATEST_VERSION"] else 1)
61+
else:
62+
sys.exit(0 if os.environ["SLV_VERSION_EXPECTED"] in os.environ["SLV_VERSION_INSTALLED"] else 1)
5163
5264
- name: Create a new SLV Environment
5365
id: new-slv-env
@@ -71,6 +83,7 @@ jobs:
7183
- name: Load SLV Vault to Environment
7284
uses: ./
7385
with:
86+
version: ${{ matrix.version }}
7487
vault: pets.slv.yml
7588
env-secret-key: ${{ steps.new-slv-env.outputs.secret_key }}
7689
prefix: "MY_"

action/dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ async function setup() {
173173
async function getSecrets(vaultFile, slvEnvSecretKey) {
174174
const options = {
175175
env: {
176-
['SLV_ENV_SECRET_KEY']: slvEnvSecretKey
176+
...process.env,
177+
'SLV_ENV_SECRET_KEY': slvEnvSecretKey
177178
},
178179
silent: true,
179180
ignoreReturnCode: true

action/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ async function setup() {
167167
async function getSecrets(vaultFile, slvEnvSecretKey) {
168168
const options = {
169169
env: {
170-
['SLV_ENV_SECRET_KEY']: slvEnvSecretKey
170+
...process.env,
171+
'SLV_ENV_SECRET_KEY': slvEnvSecretKey
171172
},
172173
silent: true,
173174
ignoreReturnCode: true

0 commit comments

Comments
 (0)