controlplaneio / kubesec-action

Runs Kubesec as GitHub action
Apache License 2.0
17 stars 2 forks source link

Scan multiple yaml files #3

Open namnx228 opened 2 years ago

namnx228 commented 2 years ago

Hi, How can I set the input to multiple files? In details, I want to scan all the yaml files in my repo. Who can I archive that? Thank you!!!

namnx228 commented 2 years ago

cc @06kellyjac

06kellyjac commented 2 years ago

I was working on multi file scanning in base kubesec but there were race condition issues due to how it was already architected

https://github.com/controlplaneio/kubesec/pull/106

You can try squash all yaml into one file

name: lint
on:
  push:
    branches:
      - master
  pull_request:
jobs:
  lint:
    name: Lint
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Collect all yaml
        run: find . -type f -name "*.yaml" -exec sh -c "echo '---' | cat - {}" \; > all.yaml

      - name: Run kubesec scanner
        uses: controlplaneio/kubesec-action@master
        with:
          input: all.yaml
namnx228 commented 2 years ago

Putting files to a single files is a good idea. Thanks!!!