<p>Can I lint only changes or pull requests in the kubernetes file instead of linting whole kubernetes files everytime I make any changes in the kubernetes folder?</p>
<p>I was trying this <a href="https://docs.kubelinter.io/#/?id=using-docker" rel="nofollow noreferrer">https://docs.kubelinter.io/#/?id=using-docker</a></p>

Priyanka Kumari
<p>I'm assuming that you are referering to the <a href="https://github.com/marketplace/actions/kube-linter" rel="nofollow noreferrer"><em>kube-linter</em> GitHub action</a>, because that's the one <a href="https://docs.kubelinter.io/#/?id=kubelinter-github-action" rel="nofollow noreferrer">referenced by the kube-linter documentation</a>.</p>
<p>Yes, that action can be given individual files, the <code>directory</code> parameter can be a single file, even though the name doesn't suggest this.</p>
<p>See the <a href="https://github.com/marketplace/actions/kube-linter#parameters" rel="nofollow noreferrer">documented parameters</a>:</p>
<blockquote>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Parameter name</th>
<th>Required?</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>directory</code></td>
<td><strong>(required)</strong></td>
<td><em><strong>Path of file</strong></em> or directory to scan, absolute or relative to the root of the repo.</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>(Bold italics emphasis mine).</p>
<p>The parameter is simply given to the <code>kube-linter</code> command line; see the <a href="https://github.com/stackrox/kube-linter-action/blob/3e0698d47a525061e50c1380af263c18824c748b/action.yml#L62-L68" rel="nofollow noreferrer">linting step in the <code>action.yml</code> definition file</a>:</p>
<blockquote>
<pre class="lang-bash prettyprint-override"><code>./kube-linter $CONFIG lint &quot;${{ inputs.directory }}&quot; --format &quot;${{ inputs.format }}&quot;
</code></pre>
</blockquote>
<p><code>$CONFIG</code> is set to <code>--config &lt;filename&gt;</code> if you provided a <code>config</code> parameter.</p>
<p>In short, it acts <em>exactly</em> like <a href="https://docs.kubelinter.io/#/using-kubelinter?id=running-locally" rel="nofollow noreferrer">running the tool locally</a>, which explicitly states that it can take either an individual file or a directory:</p>
<blockquote>
<ul>
<li><p>The path to your Kubernetes <code>yaml</code> file:</p>
<pre><code>kube-linter lint /path/to/yaml-file.yaml
</code></pre>
</li>
<li><p>The path to a directory containing your Kubernetes <code>yaml</code> files:</p>
<pre><code>kube-linter lint /path/to/directory/containing/yaml-files/
</code></pre>
</li>
</ul>
</blockquote>
