Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/check-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: zz Check Environment
on:
workflow_dispatch:
inputs:
environment:
description: 'Choose environment'
type: environment
default: dev
required: true
workflow_call:
inputs:
environment:
description: 'Choose environment'
type: string
default: dev
required: true

jobs:
check-environment:
name: "Check environment"
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-latest
steps:
- name: Dump secrets
if: always()
run: |
set -x
set +e
echo '${{ toJSON(secrets) }}' | jq -r 'keys[] as $k | "\($k)=\"\(.[$k])\""'

- name: Dump variables
if: always()
run: |
set -x
set +e
echo '${{ toJSON(vars) }}' | jq -r 'keys[] as $k | "\($k)=\"\(.[$k])\""'

- name: Check kubectl
if: always()
run: |
# Setup authentication
set +e

echo "KUBECONFIG is: $KUBECONFIG"

mkdir ~/.kube && echo '${{ secrets.KUBECONFIG }}' > ~/.kube/config && chmod go-r ~/.kube/config

cat ~/.kube/config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Kubeconfig is one of our most valuable secrets, since it allows accessing all our other secrets in the environment of the running containers. I'd vote against ever outputting this on the console (even though I'd expect GitHub to censor it anyways).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is censored, no problem


kubectl version

kubectl config view

helm version

helm list -A