Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directory only allows for one source, not multiple #13

Open
rlnrln opened this issue Jan 28, 2022 · 1 comment
Open

directory only allows for one source, not multiple #13

rlnrln opened this issue Jan 28, 2022 · 1 comment

Comments

@rlnrln
Copy link

rlnrln commented Jan 28, 2022

Our orchestration repo is big. Really big. You just won't believe how vastly hugely mind-bogglingly big it is. I mean, you may think it's a long way down the road to the chemist, but that's just peanuts to our orchestration repo.

As such, we'd like to only test files that have actually changed in a PR.

I tried some (what I though) clever shell commands, and ended up at this:

  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - run: echo "CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }} | grep 'k8s/.*\.y[a]*ml$' | tr '\n' ' ')" >> $GITHUB_ENV
 
      - name: Scan yaml files with kube-linter
        uses: stackrox/[email protected]
        id: kube-linter-action-scan
        with:
          directory: $CHANGED_FILES
          config: .kube-linter-config.yaml
          # Use plain output, because we don't have GitHub Enterprise which is required for SARIF upload
          format: plain
        continue-on-error: true

Sadly, this fails because directory is interpreted as a single file or directory; if multiple files has been changed, it will try to use "file1.yaml file2.yaml" as a single file, which will of course fail.

Suggestion: extend github action so it supports either directory or files, where the latter can take multiple files as input.

mattatcha added a commit to mattatcha/kube-linter-action that referenced this issue Jun 7, 2022
fixes: `directory` only allows for one source, not multiple stackrox#13
mattatcha added a commit to mattatcha/kube-linter-action that referenced this issue Jun 7, 2022
fixes: `directory` only allows for one source, not multiple stackrox#13
@homburg
Copy link

homburg commented Feb 23, 2024

@rlnrln deployment.yaml? Mostly harmless :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants