Skip to content

Commit dffa4bc

Browse files
committed
make the final version
1 parent 4332c91 commit dffa4bc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Load Secrets from 1Password - GitHub Action
22

3-
The action to load secrets from [1Password Connect](https://1password.com/secrets/) into GitHub Actions.
3+
This action loads secrets from [1Password Connect](https://1password.com/secrets/) into GitHub Actions.
44

55
Specify right from your workflow YAML which secrets from 1Password should be loaded into your job, and the action will make them available as environment variables for the next steps.
66

@@ -15,6 +15,8 @@ There are two ways that secrets can be loaded:
1515

1616
### Use secrets from the action's output
1717

18+
This approach enables the user to use the loaded secrets as an output from the step: `steps.step-id.outputs.secret-name`. You need to set an id for the step that uses this action to be able to access its outputs. More details about the metadata syntax [here](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_id).
19+
1820
```yml
1921
on: push
2022
jobs:
@@ -81,6 +83,8 @@ jobs:
8183
8284
### Export secrets as environment variables
8385
86+
In this approach, the user can access the loaded secrets as environment variables. These environment variables are accessible at a job level.
87+
8488
```yml
8589
on: push
8690
jobs:

entrypoint.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
77
curl -sSfLo op.zip "https://bucket.agilebits.com/cli-private-beta/v2/op_linux_amd64_v2-alpha2.zip"
88
elif [[ "$OSTYPE" == "darwin"* ]]; then
99
curl -sSfLo op.zip "https://bucket.agilebits.com/cli-private-beta/v2/op_darwin_amd64_v2-alpha2.zip"
10-
# elif [[ "$OSTYPE" == "msys"* ]]; then
11-
# curl -sSfLo op.zip "https://bucket.agilebits.com/cli-private-beta/v2/op_windows_amd64_v2-alpha2.zip"
1210
fi
1311
unzip -od /usr/local/bin/ op.zip && rm op.zip
1412
chmod +x /usr/local/bin/op
@@ -82,6 +80,7 @@ for env_var in $(op env ls); do
8280
managed_variables+=("$env_var")
8381

8482
else
83+
# Prepare the secret_value to be outputed properly (especially multiline secrets)
8584
secret_value=$(echo "$secret_value" | awk -v ORS='%0A' '1')
8685

8786
echo "::set-output name=$env_var::$secret_value"

0 commit comments

Comments
 (0)