Skip to content

Commit edc1e53

Browse files
committed
feat(linter): merge linter-actions into linter
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent a4b9ab9 commit edc1e53

File tree

5 files changed

+232
-301
lines changed

5 files changed

+232
-301
lines changed

.github/workflows/__shared-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
linter:
13-
uses: ./.github/workflows/linter-actions.yml
13+
uses: ./.github/workflows/linter.yml
1414

1515
test-action-matrix-outputs:
1616
needs: linter

.github/workflows/linter-actions.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/workflows/linter-actions.yml

Lines changed: 0 additions & 202 deletions
This file was deleted.

.github/workflows/linter.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
<!-- start description -->
1111

1212
Reusable workflow that performs linting on the codebase.
13-
Mainly using [Super-Linter](https://github.com/super-linter/super-linter), with some opinionated defaults.
13+
Executes:
14+
15+
- [Super-Linter](https://github.com/super-linter/super-linter), with some opinionated defaults.
16+
- [CodeQL](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql) to analyze the code.
17+
- [Ratchet](https://github.com/sethvargo/ratchet) to check that GitHub Action versions are pinned.
1418

1519
<!-- end description -->
1620
<!-- start contents -->
@@ -38,10 +42,35 @@ permissions:
3842
jobs:
3943
main:
4044
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@0.14.0
45+
with:
46+
# Json array of runner(s) to use.
47+
# See <https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job>.
48+
runs-on: '["ubuntu-latest"]'
49+
50+
# Environment variables in multilines format "key=value" to pass to the linter.
51+
# See <https://github.com/super-linter/super-linter>.
52+
linter-env: ""
53+
54+
# JSON array of languages to analyze with CodeQL.
55+
# See <https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/>.
56+
# Leave empty to disable the check.
57+
codeql-languages: '["actions"]'
58+
59+
# List of files or directories where GitHub Actions and workflows are located.
60+
# Supports glob patterns.
61+
# Leave empty to disable the check.
62+
action-files: |
63+
./action.yml
64+
./.github/workflows/**/*.yml
65+
./actions/**/*.yml
66+
67+
# Run checks on all files, not just the changed ones.
68+
lint-all: ${{ github.event_name != 'pull_request' }}
69+
4170
secrets:
4271
# Token for marking the status of linter run in the Checks section.
4372
# See https://github.com/super-linter/super-linter#how-to-use
44-
# Default GITHUB_TOKEN
73+
# Default GITHUB_TOKEN.
4574
github-token: ""
4675
```
4776
@@ -61,10 +90,13 @@ jobs:
6190
6291
<!-- start inputs -->
6392
64-
| **Input** | **Description** | **Default** | **Type** | **Required** |
65-
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------- | ------------ |
66-
| **<code>runs-on</code>** | Json array of runner(s) to use. See <https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job>. | <code>["ubuntu-latest"]<code> | `string` | **false** |
67-
| **<code>linter-env</code>** | Environment variables in multilines format "key=value" to pass to the linter. See <https://github.com/super-linter/super-linter>. | <code>.github/workflows\nactions</code> | `string` | **false** |
93+
| **Input** | **Description** | **Default** | **Type** | **Required** |
94+
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------- | ------------ |
95+
| **<code>runs-on</code>** | Json array of runner(s) to use. See <https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job>. | <code>["ubuntu-latest"]<code> | `string` | **false** |
96+
| **<code>linter-env</code>** | Environment variables in multilines format "key=value" to pass to the linter. See <https://github.com/super-linter/super-linter>. | <code>.github/workflows\nactions</code> | `string` | **false** |
97+
| **<code>codeql-languages</code>** | JSON array of languages to analyze with CodeQL. See <https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/>. Leave empty to disable the check. | <code>["actions"]</code> | `string` | **false** |
98+
| **<code>action-files</code>** | List of files or directories where GitHub Actions and workflows are located. Supports glob patterns. Leave empty to disable the check. | <code>./action.yml\n./.github/workflows/\*\*/\*.yml\n./actions/\*\*/\*.yml</code> | `string` | **false** |
99+
| **<code>lint-all</code>** | Run linter on all files, not just the changed ones. | <code>github.event_name != 'pull_request'</code> | `boolean` | **false** |
68100

69101
<!-- end inputs -->
70102

0 commit comments

Comments
 (0)