diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 0000000..3d0e3a0 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,6 @@ +# MD013/line-length - Line length +MD013: + # Number of characters, default is 80 + line_length: 9999 + # check code blocks? + code_blocks: false \ No newline at end of file diff --git a/.github/workflows/call-local-super-linter.yaml b/.github/workflows/call-local-super-linter.yaml new file mode 100644 index 0000000..ccd8a6e --- /dev/null +++ b/.github/workflows/call-local-super-linter.yaml @@ -0,0 +1,24 @@ +--- +# THIS IS NOT A TEMPLATE. +# This is just for linting the gha-workflows repo itself. +# We call the reusable workflow from its file path. + +name: Lint + +on: + push: + branches: + - main + + pull_request: + +jobs: + call-super-linter: + + name: Call Super-Linter + + uses: ./.github/workflows/super-linter.yaml + + permissions: + contents: read # clone the repo to lint + statuses: write #read/write to repo custom statuses \ No newline at end of file diff --git a/README.md b/README.md index 9665118..6a36589 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,15 @@ The GitHub [Super-Linter](https://github.com/marketplace/actions/super-linter) p ## Features of this custom Super-Linter example -- All the features of [Super-Linter](https://github.com/marketplace/actions/super-linter) in a *Reusable* Workflow -- Bonus: Optionally turn off non-DevOps linters (CSS, JS, HTML, etc.) when you want to ignore code (in my case it's to ignore sample code I stick in DevOps projects) -- Bonus: I added Job steps to correctly determine which branch to diff files with (in the case of having multiple release branches) -- Bonus: Lints only changed files on a PR, but lints all files on merge to main (or any release) branch +- All the features of [Super-Linter](https://github.com/marketplace/actions/super-linter) in a *Reusable* Workflow. +- Bonus: Optionally turn off non-DevOps linters (CSS, JS, HTML, etc.) when you want to ignore code (in my case it's to ignore sample code I stick in DevOps projects). +- Bonus: I added Job steps to correctly determine which branch to diff files with (in the case of having multiple release branches). +- Bonus: Lints only changed files on a PR, but lints all files on merge to main (or any release) branch. ## How to reuse this example as a *Reusable* Workflow -1. Fork this repository for you to customize your linters -2. Add a workflow to all your other repositories that calls your linter workflow using GitHub's "Reusable Workflow" -3. Add something similar to this to those workflows: +1. Fork this repository for you to customize your linters in a single location for your org/projects. +2. Add a new workflow to all your other repositories and paste in this YAML to call the central-repos reusable workflow. ```yaml ---