Skip to content

Commit 6bf0335

Browse files
committed
chore: fix lint issues
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 5971fd4 commit 6bf0335

7 files changed

Lines changed: 38 additions & 37 deletions

File tree

.github/linters/.jscpd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"threshold": 5,
3-
"ignore": ["/workspace/actions/**/README.md"]
3+
"ignore": ["**/tests/*"]
44
}

.github/linters/.yaml-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
extends: default
33

44
ignore:
5-
- /github/workspace/tests/charts/
5+
- "**/tests/charts/**"
66

77
rules:
88
line-length:

.github/workflows/docker-build-images.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ If a platform entry omits the <code>runs-on</code> field, the following default
235235
- When the main <code>docker-build-images</code> job uses a standard hosted runner, that runner is automatically matched to each platform.
236236
- If the main <code>docker-build-images</code> job uses a custom or self-hosted runner, all platforms use the same runner.
237237

238+
<!--
239+
// jscpd:ignore-start
240+
-->
241+
238242
<!-- outputs:start -->
239243

240244
## Outputs
@@ -252,10 +256,6 @@ If a platform entry omits the <code>runs-on</code> field, the following default
252256
<!-- examples:start -->
253257
<!-- examples:end -->
254258

255-
<!--
256-
// jscpd:ignore-start
257-
-->
258-
259259
<!-- contributing:start -->
260260

261261
## Contributing

README.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,36 @@ actions/{category}/{action-name}/
7676
1. **Consistent branding**: Use `author: hoverkraft` with `color: blue` and a meaningful `icon`.
7777
2. **Pinned dependencies**: Reference third-party actions via exact SHAs to guarantee reproducibility.
7878
3. **Input validation**: Validate critical inputs early within composite steps or supporting scripts.
79+
4. **Idempotent steps**: Ensure actions can run multiple times without leaving residual state in the workspace.
80+
5. **Multi-platform support**: Test actions in both `ubuntu-latest` and `windows-latest` runners when applicable.
81+
6. **Cross-platform compatibility**: Uses `actions/github-script` steps for cross-platform compatibility. Avoid `run` steps.
82+
7. **Logging**: Use structured logs with clear prefixes (`[build-image]`, `[helm-test-chart]`, …) to simplify debugging.
83+
8. **Security**: Avoid shell interpolation with untrusted inputs; prefer parameterized commands or `set -euo pipefail` wrappers.
84+
85+
#### File Conventions
86+
87+
- **Dockerfile**: Provides the Super Linter environment with UID/GID passthrough for local dev parity.
88+
- **Tests**: Located in `tests/` with fixtures for container builds and chart-testing scenarios.
89+
- **Workflows**: Reusable definitions live in `.github/workflows/`; internal/private workflows are prefixed with `__`.
90+
91+
#### JavaScript Development Patterns
92+
93+
- Encapsulate reusable logic in modules under the action directory (for example, `actions/my-action/index.js`).
94+
- Prefer async/await with explicit error handling when interacting with the GitHub API or filesystem.
95+
- Centralize environment variable parsing and validation to keep composite YAML lean.
7996

8097
#### Container Delivery Patterns
8198

8299
- Prefer multi-architecture builds via `docker buildx build` with explicit `--platform` lists.
83100
- Surface provenance metadata through outputs (`image-name`, `digest`, etc.) to unblock downstream jobs.
84101
- Keep secrets and registry credentials in GitHub environments or organization secrets—never hardcode them.
85102

103+
#### Helm Testing Patterns
104+
105+
- Use the chart fixtures under `tests/charts/` to exercise Helm-focused actions.
106+
- Maintain `Chart.lock` files alongside `Chart.yaml` to document dependency revisions.
107+
- Commit `ci/empty-values.yaml` templates for creating scenario-specific overrides.
108+
86109
### Development Workflow
87110

88111
#### Linting & Testing
@@ -96,30 +119,6 @@ make test-build-application # Build and push the sample test application image
96119
make test-ct-install # Validate Helm charts via chart-testing
97120
```
98121

99-
#### File Conventions
100-
101-
- **Dockerfile**: Provides the Super Linter environment with UID/GID passthrough for local dev parity.
102-
- **Tests**: Located in `tests/` with fixtures for container builds and chart-testing scenarios.
103-
- **Workflows**: Reusable definitions live in `.github/workflows/`; internal/private workflows are prefixed with `__`.
104-
105-
#### Action Development Conventions
106-
107-
1. **Idempotent steps**: Ensure actions can run multiple times without leaving residual state in the workspace.
108-
2. **Logging**: Use structured logs with clear prefixes (`[build-image]`, `[helm-test-chart]`, …) to simplify debugging.
109-
3. **Security**: Avoid shell interpolation with untrusted inputs; prefer parameterized commands or `set -euo pipefail` wrappers.
110-
111-
#### JavaScript Development Patterns
112-
113-
- Encapsulate reusable logic in modules under the action directory (for example, `actions/docker/prune-pull-requests-image-tags/index.js`).
114-
- Prefer async/await with explicit error handling when interacting with the GitHub API or filesystem.
115-
- Centralize environment variable parsing and validation to keep composite YAML lean.
116-
117-
#### Helm Testing Patterns
118-
119-
- Use the chart fixtures under `tests/charts/` to exercise Helm-focused actions.
120-
- Maintain `Chart.lock` files alongside `Chart.yaml` to document dependency revisions.
121-
- Commit `ci/empty-values.yaml` templates for creating scenario-specific overrides.
122-
123122
## Author
124123

125124
🏢 **Hoverkraft <contact@hoverkraft.cloud>**

actions/docker/build-image/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ runs:
242242
with:
243243
platforms: ${{ inputs.platform }}
244244

245+
# jscpd:ignore-start
245246
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
246247
with:
247248
# FIXME: upgrade version when available (https://github.com/docker/buildx/releases)
@@ -255,6 +256,7 @@ runs:
255256
registry: ${{ inputs.oci-registry }}
256257
username: ${{ inputs.oci-registry-username }}
257258
password: ${{ inputs.oci-registry-password }}
259+
# jscpd:ignore-end
258260

259261
- id: build
260262
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0

tests/charts/application/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ A Helm chart for Kubernetes
66

77
## Requirements
88

9-
| Repository | Name | Version |
10-
| ---------------------------------- | ----- | ------- |
11-
| https://charts.bitnami.com/bitnami | mysql | 14.0.3 |
9+
| Repository | Name | Version |
10+
| ------------------------------------ | ----- | ------- |
11+
| <https://charts.bitnami.com/bitnami> | MySQL | 14.0.3 |
1212

1313
## Values
1414

tests/charts/umbrella-application/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ An umbrella Helm chart for Kubernetes
66

77
## Requirements
88

9-
| Repository | Name | Version |
10-
| ---------------------------------- | --------------- | ------- |
11-
| file://./charts/app | app | 0.0.0 |
12-
| https://charts.bitnami.com/bitnami | database(mysql) | 14.0.3 |
9+
| Repository | Name | Version |
10+
| ------------------------------------ | --------------- | ------- |
11+
| file://./charts/app | app | 0.0.0 |
12+
| <https://charts.bitnami.com/bitnami> | database(MySQL) | 14.0.3 |
1313

1414
## Values
1515

0 commit comments

Comments
 (0)