From eb5e1d128de38d5c1ef8f55b2e74074e19498d43 Mon Sep 17 00:00:00 2001 From: devourer66 <57077168+devourer66@users.noreply.github.com> Date: Tue, 6 Feb 2024 13:41:58 +0000 Subject: [PATCH] Fix linting error, added runner config passthrough [+] additional input in `reusable-super-linter.yaml` to control `runs-on:` [+] commented example how to run `call-local-super-linter.yaml` on a self-hosted GHA runner [+] updated `README` with example of usage [!] fixed linting error by adding `permissions: {}` on the workflow level of `call-local-super-linter.yaml` --- .github/workflows/call-local-super-linter.yaml | 7 ++++++- .github/workflows/reusable-super-linter.yaml | 7 ++++++- README.md | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/call-local-super-linter.yaml b/.github/workflows/call-local-super-linter.yaml index df889c2..8a3c113 100644 --- a/.github/workflows/call-local-super-linter.yaml +++ b/.github/workflows/call-local-super-linter.yaml @@ -5,6 +5,9 @@ name: Lint +# disable all permissions by default. We will enable necessary permissions in a job +permissions: {} + on: push: branches: @@ -23,7 +26,9 @@ jobs: name: Call Super-Linter uses: ./.github/workflows/reusable-super-linter.yaml +# with: +# runner-labels: '["self-hosted", "Linux"]' permissions: contents: read # clone the repo to lint - statuses: write #read/write to repo custom statuses \ No newline at end of file + statuses: write #read/write to repo custom statuses diff --git a/.github/workflows/reusable-super-linter.yaml b/.github/workflows/reusable-super-linter.yaml index 170fcd4..628f3ac 100644 --- a/.github/workflows/reusable-super-linter.yaml +++ b/.github/workflows/reusable-super-linter.yaml @@ -26,6 +26,11 @@ on: description: A regex to exclude files from linting required: false type: string + runner-labels: + description: 'runs-on override (format: ''["self-hosted", "Linux"]'')' + required: false + type: string + default: '["ubuntu-latest"]' permissions: contents: read # git permissions to repo pull/push @@ -36,7 +41,7 @@ jobs: name: Super-Linter - runs-on: ubuntu-latest + runs-on: "${{ fromJSON(inputs.runner-labels) }}" steps: - name: Checkout Code diff --git a/README.md b/README.md index 67bb6d9..e97ad64 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,11 @@ jobs: ### A regex to exclude files from linting ### defaults to empty # filter-regex-exclude: html/.* + + ### For adjusting the runner's configuration + ### defaults to '["ubuntu-latest"]' + # runner-labels: '["self-hosted", "Linux"]' + ``` ## How to run Super-Linter locally