From e2f00af3725e44fb10d09c3ae322a13839163339 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Wed, 18 Dec 2024 13:41:37 -0600 Subject: [PATCH] Lint & Format workflow --- .github/workflows/lint-format.yaml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/lint-format.yaml diff --git a/.github/workflows/lint-format.yaml b/.github/workflows/lint-format.yaml new file mode 100644 index 0000000..3d4eecf --- /dev/null +++ b/.github/workflows/lint-format.yaml @@ -0,0 +1,47 @@ +--- +name: Lint & Format +on: + pull_request: + paths: + - "**.sh" + - ".github/workflows/*.yaml" + - "action.yaml" + - "gha_extract_shell_scripts.py" + +jobs: + workflow-scripts: + name: Extract workflow scripts + runs-on: ubuntu-latest + # These permissions are needed to: + # - Checkout the Git repo (`contents: read`) + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - name: Extract workflow shell scripts + id: extract + uses: ./ + - uses: actions/upload-artifact@v4 + with: + name: workflow-scripts + path: ${{ steps.extract.outputs.output-dir }} + + lint-format: + name: Lint & Format + needs: workflow_scripts + # These permissions are needed to: + # - Checkout the Git repo (`contents: read`) + # - Post a comments on PRs: https://github.com/luizm/action-sh-checker#secrets + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download workflow scripts + uses: actions/download-artifact@v4 + with: + name: workflow-scripts + - uses: luizm/action-sh-checker@c6edb3de93e904488b413636d96c6a56e3ad671a # v0.8.0 + with: + sh_checker_comment: true