Skip to content

Commit

Permalink
Update test2.yaml
Browse files Browse the repository at this point in the history
Update README.md

Update test2.yaml

Update test2.yaml

Update test2.yaml

Update test2.yaml

Update Dockerfile

Update test2.yaml

Update test2.yaml

Update test2.yaml

Update test2.yaml

Update test2.yaml

Update test2.yaml

Update test2.yaml

Update test2.yaml
  • Loading branch information
rbalashevich committed Jul 13, 2022
1 parent 55d1661 commit fc82a07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ jobs:
uses: actions/checkout@v3
- name: Write kubeconfig to file
run: echo "${{ secrets.KUBECONFIG_CONTENT }}" > mykubeconfig
- name: Verify kubeconfig substitution
- name: Verify kubeconfig substitution and set context
id: verifyandset
run: |
var=$(kubectl config current-context)
echo $KUBECONFIG
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
kubectl config current-context
kubectl get pod -A
echo "::set-output name=KUBE_CONTEXT::$var"
env:
KUBECONFIG: mykubeconfig
- name: Scan cluster
uses: otomato-gh/kubescape-action@main
with:
ksversion: 'v2.0.155'
format: 'json'
context: ${{ steps.savecontext.outputs.KUBE_CONTEXT }}
context: ${{ steps.verifyandset.outputs.KUBE_CONTEXT }}
env:
KUBECONFIG: mykubeconfig
- name: Retrieve Scan Results via File Upload
Expand Down
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@ FROM ubuntu:20.04
ARG KUBECONFIG_CONTENT
ENV kubeconfig_content=$KUBECONFIG_CONTENT

RUN echo $kubeconfig_content
# RUN echo $kubeconfig_content

RUN mkdir .kube
RUN echo "$kubeconfig_content" > /.kube/config

RUN export KUBECONFIG=/.kube/config

RUN ls -a /
RUN ls -a /.kube

RUN ls -a /.kube/config
RUN cat /.kube/config
# RUN ls -a /.kube
# RUN cat /.kube/config

ENV KUBESCAPE_SKIP_UPDATE_CHECK 1
RUN apt-get update && apt-get install -y curl
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ How to use kubescape in CI. Sample actions. Desired features (schematically, wit
ksversion: 'v2.0.155'
# [⚠️ Required]
# A version of involved binary (See ARMO releases page: https://github.com/armosec/kubescape/releases ).
path: '.'
path: ''
# [⚙️ Optional]
# A path where to look for deployments' YAML to scan. Default is repo's home dir.
threshold: 20
Expand Down

0 comments on commit fc82a07

Please sign in to comment.