Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
Fix #4 set-env (#5)
Browse files Browse the repository at this point in the history
* fix #4 set-env

* Update main.yml

* Update to self-hosted runner & new lab env

* Update main.yml

* Update main.yml

* Update README.md
  • Loading branch information
infamousjoeg authored Mar 7, 2022
1 parent 783413e commit 60caaad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
push:
branches:
- master
pull_request:
schedule:
- cron: 0 0 ? * *

jobs:
test:
runs-on: ubuntu-latest
runs-on: self-hosted

steps:
- uses: actions/checkout@v1
Expand All @@ -20,6 +21,8 @@ jobs:
account: cyberarkdemo
host_id: ${{ secrets.CONJUR_USERNAME }}
api_key: ${{ secrets.CONJUR_API_KEY }}
secrets: db/sqlusername | sql_username; db/sql_password
- name: Check Environment Outside Docker Container for Secret Masking
run: env | grep SQL_
secrets: SyncVault/LOB_CI/D-Win-SvcAccts/Operating System-WinDomain-joegarcia.dev-Svc_SSIS/username|sql_username;SyncVault/LOB_CI/D-Win-SvcAccts/Operating System-WinDomain-joegarcia.dev-Svc_SSIS/password|sql_password
- name: Check SQL_USERNAME Outside Docker Container for Secret Masking
run: printenv SQL_USERNAME | sed 's/./& /g'
- name: Check SQL_PASSWORD Outside Docker Container for Secret Masking
run: printenv SQL_PASSWORD | sed 's/./& /g'
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
account: cyberarkdemo
host_id: ${{ secrets.CONJUR_USERNAME }}
api_key: ${{ secrets.CONJUR_API_KEY }}
secrets: db/sqlusername | sql_username; db/sql_password
secrets: db/sqlusername|sql_username;db/sql_password
# ...
```

Expand All @@ -41,15 +41,15 @@ jobs:

## Secrets Syntax

`{{ conjurVariable1 | envVarName1; conjurVariable2 }}`
`{{ conjurVariable1|envVarName1;conjurVariable2 }}`

The `secrets` argument is a semi-colon (`;`) delimited list of secrets. The list can optionally contain the name to set for the environment variable.
The `secrets` argument is a semi-colon (`;`) delimited list of secrets. Spaces are NOT SUPPORTED. The list can optionally contain the name to set for the environment variable.

### Example

`db/sqlusername | sql_username; db/sql_password`
`db/sqlusername|sql_username;db/sql_password`

In the above example, the first secret section is `db/sqlusername | sql_username`. The `|` separates the Conjur Variable ID from the environment variable that will contain the value of the Conjur Variable's value.
In the above example, the first secret section is `db/sqlusername|sql_username`. The `|` separates the Conjur Variable ID from the environment variable that will contain the value of the Conjur Variable's value.

The second secret section is `db/sql_password`. When no name is given for the environment variable, the Conjur Variable Name will be used. In this example, the value would be set to `SQL_PASSWORD` as the environment variable name.

Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ set_secrets() {
fi

echo ::add-mask::"${secretVal}" # Masks the value in all logs & output
echo ::set-env name="${envVar}"::"${secretVal}" # Set environment variable
echo "${envVar}=${secretVal}" >> $GITHUB_ENV # Set environment variable
done
}

Expand Down

0 comments on commit 60caaad

Please sign in to comment.