-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (43 loc) · 2.14 KB
/
demo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Test GHA with Keeper
# Triggers the workflow manually from the GitHub Actions tab
on:
workflow_dispatch:
jobs:
build:
name: Build and Retrieve Secrets
environment: test
runs-on: ubuntu-latest # The type of runner that the job will execute on
steps:
# Step 1: Retrieve secrets from Keeper
- name: Retrieve secrets from Keeper
id: ksecrets # This ID will be used to reference outputs from this step
uses: Keeper-Security/ksm-action@master
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }} # Secret config needed to access Keeper
secrets: |-
GzPJKNrw4TAvdX29NORoXA/title > REC_TITLE
GzPJKNrw4TAvdX29NORoXA/type > REC_TYPE
GzPJKNrw4TAvdX29NORoXA/field/login > LOGIN
GzPJKNrw4TAvdX29NORoXA/field/password > PASSWORD
GzPJKNrw4TAvdX29NORoXA/custom_field/ExampleMultilineText > env:ExampleMultilineText
GzPJKNrw4TAvdX29NORoXA/file/command.txt > file:/tmp/cmd.txt
GitHub Action: Keeper Demo - Login/field/login > env:LOGIN2
GitHub Action: Keeper Demo - Login/field/password > env:PASSWORD2
# GitHub Action: Keeper Demo - Login/file/image.png > file:/tmp/img.png
# Step 2: Print and Reverse Step Output Variables
- name: Print and Reverse Step Output Variables
run: |
echo "Record Title is: $(echo '${{ steps.ksecrets.outputs.REC_TITLE }}' | rev)"
echo "Record Type is: $(echo '${{ steps.ksecrets.outputs.REC_TYPE }}' | rev)"
echo "Login is: $(echo '${{ steps.ksecrets.outputs.LOGIN }}' | rev)"
echo "Password is: $(echo '${{ steps.ksecrets.outputs.PASSWORD }}' | rev)"
# Step 3: Print and Reverse Environment Variables
- name: Print and Reverse Environment Variables
run: |
echo "ExampleMultilineText is: $(echo '${{ env.ExampleMultilineText }}' | rev)"
echo "Login2 is: $(echo '${{ env.LOGIN2 }}' | rev)"
echo "Password2 is: $(echo '${{ env.PASSWORD2 }}' | rev)"
# Step 4: Print Reversed File Content
- name: Print Reversed File Content
run: |
rev /tmp/cmd.txt