Skip to content

Commit

Permalink
DEVOPS-7881 add mask
Browse files Browse the repository at this point in the history
  • Loading branch information
Decard6 committed Jun 25, 2024
1 parent f147575 commit 5fbd22a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 39 deletions.
32 changes: 0 additions & 32 deletions 1password/get-item-field/action.yaml

This file was deleted.

18 changes: 11 additions & 7 deletions 1password/get-kubeconfig/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@ outputs:
runs:
using: "composite"
steps:
- name: Install 1Password CLI
uses: 1password/install-cli-action@v1

- name: Get Kubeconfig from 1Password
id: get-kubeconfig
uses: PiwikPRO/actions/1password/get-item-field@master
with:
op-sa-token: ${{ inputs.op-sa-token }}
op-vault: ${{ inputs.op-vault }}
op-item: ${{ inputs.op-item }}
op-field: kubeconfig
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ inputs.op-sa-token }}
shell: bash
run: |
encoded=$(op item get ${{ inputs.op-item }} --vault=${{ inputs.op-vault }} --fields label=kubeconfig| tr -d "\n" )
echo "::add-mask::$encoded"
echo "encoded<<EOF"$'\n'"$encoded"$'\n'EOF >> "$GITHUB_OUTPUT"
- name: Decode kubeconfig
id: decode-kubeconfig
shell: bash
run: echo "kubeconfig<<EOF"$'\n'"$(echo '${{ steps.get-kubeconfig.outputs.field }}' | tr -d "\"" | base64 --decode)"$'\n'EOF >> "$GITHUB_OUTPUT"
run: echo "kubeconfig<<EOF"$'\n'"$(echo '${{ steps.get-kubeconfig.outputs.encoded }}' | tr -d "\"" | base64 --decode)"$'\n'EOF >> "$GITHUB_OUTPUT"

0 comments on commit 5fbd22a

Please sign in to comment.