Skip to content

Commit 9d7f8c5

Browse files
committed
Use pre-commit-configs
Signed-off-by: osamamagdy <[email protected]>
1 parent d125c2e commit 9d7f8c5

File tree

6 files changed

+49
-19
lines changed

6 files changed

+49
-19
lines changed

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
TF_DOCS_VERSION: v0.16.0
1111
TFLINT_VERSION: v0.44.1
1212
TF_VERSION: "1.3.4"
13+
HELM_DOCS_VERSION: "1.7.0"
1314
permissions:
1415
contents: read
1516
jobs:
@@ -42,6 +43,12 @@ jobs:
4243
tar -zxvf terraform_docs.tar.gz terraform-docs
4344
chmod +x terraform-docs
4445
mv terraform-docs /usr/local/bin/
46+
- name: Setup helm-docs
47+
run: |
48+
cd /tmp
49+
wget https://github.com/norwoodj/helm-docs/releases/download/v${{env.HELM_DOCS_VERSION}}/helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
50+
tar -xvf helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
51+
sudo mv helm-docs /usr/local/sbin
4552
- name: Pre-commit checks
4653
uses: pre-commit/[email protected]
4754
- name: pre-commit-ci-lite

.github/workflows/publish.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ jobs:
1212
run: |
1313
git config user.name "$GITHUB_ACTOR"
1414
git config user.email "[email protected]"
15+
- name: "Install yq"
16+
run: |
17+
sudo snap install yq
18+
- name: "Patch Chart.yaml to the current released version"
19+
working-directory: helm/wrongsecrets-ctf-party/
20+
run: |
21+
RELEASE_VERSION="${GITHUB_REF#refs/*/}"
22+
# Remove leading 'v' from git tag to create valid semver
23+
RELEASE_VERSION="${RELEASE_VERSION//v}"
24+
# patch the version & appVersion in the Chart.yaml to the release version
25+
yq eval -i ".version = \"$RELEASE_VERSION\", .appVersion = \"$RELEASE_VERSION\"" Chart.yaml
1526
- name: install helm-docs
1627
env:
1728
HELM_DOCS_VERSION: "1.7.0"
@@ -22,7 +33,7 @@ jobs:
2233
sudo mv helm-docs /usr/local/sbin
2334
- name: Generate and Release Helm Docs
2435
run: |
25-
helm-docs -t helm/wrongsecrets-ctf-party/README.md.gotmpl -o README.md
36+
helm-docs -t helm/wrongsecrets-ctf-party/README.md.gotmpl -t helm/wrongsecrets-ctf-party/_template.gotmpl -o README.md
2637
cp helm/wrongsecrets-ctf-party/README.md /tmp/README.md
2738
- name: Update gh-pages branch
2839
uses: actions/checkout@v3
@@ -44,17 +55,6 @@ jobs:
4455
fi
4556
- name: Get back to original branch
4657
uses: actions/checkout@v3
47-
- name: "Install yq"
48-
run: |
49-
sudo snap install yq
50-
- name: "Patch Chart.yaml to the current released version"
51-
working-directory: helm/wrongsecrets-ctf-party/
52-
run: |
53-
RELEASE_VERSION="${GITHUB_REF#refs/*/}"
54-
# Remove leading 'v' from git tag to create valid semver
55-
RELEASE_VERSION="${RELEASE_VERSION//v}"
56-
# patch the version & appVersion in the Chart.yaml to the release version
57-
yq eval -i ".version = \"$RELEASE_VERSION\", .appVersion = \"$RELEASE_VERSION\"" Chart.yaml
5858
- name: Run chart-releaser
5959
uses: helm/[email protected]
6060
with:

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ repos:
3131
- "--args=--only=terraform_standard_module_structure"
3232
- "--args=--only=terraform_workspace_remote"
3333
- id: terraform_docs
34+
- repo: https://github.com/norwoodj/helm-docs
35+
rev: v1.2.0
36+
hooks:
37+
- id: helm-docs
38+
args:
39+
# Make the tool search for charts only under the `example-charts` directory
40+
- --chart-search-root=helm
41+
42+
# The `./` makes it relative to the chart-search-root set above
43+
- --template-files=./_templates.gotmpl
44+
45+
# Repeating the flag adds this to the list, now [./_templates.gotmpl, README.md.gotmpl]
46+
# A base filename makes it relative to each chart directory found
47+
- --template-files=README.md.gotmpl
3448
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
3549
rev: v9.4.0
3650
hooks:

helm/wrongsecrets-ctf-party/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: wrongsecrets-ctf-party
33
description: Run Multi User "Capture the Flags" or Security Trainings with OWASP Wrongsecrets
44
icon: https://github.com/OWASP/wrongsecrets/blob/master/icon.png?raw=true
55

6-
home: https://github.com/
6+
home: https://owasp.org/www-project-wrongsecrets/
77
sources:
88
- https://github.com/OWASP/wrongsecrets-ctf-party
99

helm/wrongsecrets-ctf-party/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,19 @@ To install the wrongsecrets-ctf-party chart:
3838
To uninstall the chart:
3939

4040
helm delete my-wrongsecrets-ctf-party
41+
# wrongsecrets-ctf-party
4142

42-
## Configuration
43+
![Version: 0.1.0-alpha](https://img.shields.io/badge/Version-0.1.0--alpha-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.9](https://img.shields.io/badge/AppVersion-1.5.9-informational?style=flat-square)
44+
45+
Run Multi User "Capture the Flags" or Security Trainings with OWASP Wrongsecrets
46+
47+
**Homepage:** <https://owasp.org/www-project-wrongsecrets/>
48+
49+
## Source Code
50+
51+
* <https://github.com/OWASP/wrongsecrets-ctf-party>
52+
53+
## Values
4354

4455
| Key | Type | Default | Description |
4556
|-----|------|---------|-------------|
@@ -175,3 +186,6 @@ To uninstall the chart:
175186
| wrongsecretsCleanup.successfulJobsHistoryLimit | int | `1` | |
176187
| wrongsecretsCleanup.tag | float | `0.4` | |
177188
| wrongsecretsCleanup.tolerations | list | `[]` | Optional Configure kubernetes toleration for the wrongsecretsCleanup Job (see: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
189+
190+
----------------------------------------------
191+
Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0)

helm/wrongsecrets-ctf-party/README.md.gotmpl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,3 @@ To install the wrongsecrets-ctf-party chart:
3939
To uninstall the chart:
4040

4141
helm delete my-wrongsecrets-ctf-party
42-
43-
44-
## Configuration
45-
46-
{{ template "chart.valuesTable" . }}

0 commit comments

Comments
 (0)