From ee7e8c6ae1d8714cfaca9d690c84cd94414fbdd0 Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Mon, 30 Jan 2023 16:11:23 +0100 Subject: [PATCH 1/2] ci(lint): Add missing permission and update ShellCheck Action --- .github/workflows/linters.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index 51a49260ff..fe0a2671b6 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -11,16 +11,27 @@ defaults: shell: bash -o pipefail {0} jobs: - lint: + lint-shell: runs-on: ubuntu-latest + permissions: + security-events: write + steps: - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Lint shell scripts - uses: redhat-plumbers-in-action/differential-shellcheck@v3 + - id: ShellCheck + name: Lint shell scripts + uses: redhat-plumbers-in-action/differential-shellcheck@v4 with: token: ${{ secrets.GITHUB_TOKEN }} + + - if: ${{ always() }} + name: Upload artifact with ShellCheck defects in SARIF format + uses: actions/upload-artifact@v3 + with: + name: Differential ShellCheck SARIF + path: ${{ steps.ShellCheck.outputs.sarif }} From 1b28cdf3f45326c8a6521dca71ed861bfe46a34b Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Mon, 30 Jan 2023 16:15:01 +0100 Subject: [PATCH 2/2] ci(lint): Add differential PyLint GitHub Action --- .github/workflows/linters.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index fe0a2671b6..e26196e737 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -35,3 +35,30 @@ jobs: with: name: Differential ShellCheck SARIF path: ${{ steps.ShellCheck.outputs.sarif }} + + lint-python: + runs-on: ubuntu-latest + + permissions: + security-events: write + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - id: VCS_Diff_Lint + name: Lint python scripts + uses: fedora-copr/vcs-diff-lint-action@v1 + + - if: ${{ always() }} + name: Upload artifact with detected defects in SARIF format + uses: actions/upload-artifact@v3 + with: + name: VCS Diff Lint SARIF + path: ${{ steps.VCS_Diff_Lint.outputs.sarif }} + + - if: ${{ failure() }} + name: Upload SARIF to GitHub using github/codeql-action/upload-sarif + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: ${{ steps.VCS_Diff_Lint.outputs.sarif }}