Skip to content

Commit 220236e

Browse files
committed
feat(helm): skip documentation setup for verified unrelated changes
1 parent 7442ea5 commit 220236e

10 files changed

Lines changed: 646 additions & 22 deletions

File tree

‎.github/workflows/__shared-ci.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ jobs:
117117
permissions:
118118
contents: read
119119

120+
test-action-helm-generate-docs:
121+
needs: lint
122+
uses: $/.github/workflows/__test-action-helm-generate-docs.yml
123+
permissions:
124+
contents: read
125+
id-token: write
126+
packages: read
127+
pull-requests: write
128+
security-events: write
129+
120130
test-action-helm-prepare-chart:
121131
needs: lint
122132
uses: $/.github/workflows/__test-action-helm-prepare-chart.yml
@@ -244,6 +254,7 @@ jobs:
244254
reports:
245255
needs:
246256
- lint
257+
- test-action-helm-generate-docs
247258
- test-action-helm-prepare-chart
248259
- test-action-helm-prepare-release
249260
- test-action-helm-lint-chart
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Test for "helm/generate-docs" action
3+
run-name: Test for "helm/generate-docs" action
4+
5+
on: # yamllint disable-line rule:truthy
6+
workflow_call:
7+
8+
permissions: {}
9+
10+
jobs:
11+
continuous-integration:
12+
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@6dee39a2a74172ea5539caa886a12b32765d5bd1 # 3.0.3
13+
permissions:
14+
contents: read
15+
id-token: write
16+
packages: read
17+
pull-requests: write
18+
security-events: write
19+
with:
20+
working-directory: actions/helm/generate-docs
21+
build: ""
22+
lint: ""
23+
code-ql: '{"languages":"typescript","config-file":".github/codeql/config.yml"}'
24+
test: '{"comment":false,"report-group":"test-action-helm-generate-docs"}'

‎actions/helm/generate-docs/README.md‎

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Mainly using [losisin/helm-docs-github-action](https://github.com/losisin/helm-d
3636
## Usage
3737

3838
```yaml
39-
- uses: hoverkraft-tech/ci-github-container/actions/helm/generate-docs@3feb56e45f82273a7eded46ac3b9364c08337cee # 3.0.0
39+
- uses: hoverkraft-tech/ci-github-container/actions/helm/generate-docs@7442ea53022a6365d3be7259634aaaf095bf5d3f # feat/review-ci-composition
4040
with:
4141
# Working directory
4242
# Default: `${{ github.workspace }}`
@@ -53,6 +53,20 @@ Mainly using [losisin/helm-docs-github-action](https://github.com/losisin/helm-d
5353
# See https://github.com/losisin/helm-values-schema-json-action.
5454
values-file: ""
5555

56+
# Optional newline-separated repository-relative files or directories whose changes cannot affect chart documentation.
57+
# Paths are literal, and directories must end with a slash. Empty keeps generation unconditional.
58+
# On the first attempt of a default-branch push, skip only when every change since the same workflow's last successful push is listed.
59+
# Chart search paths and the explicit values file always require generation. Missing history, API/Git uncertainty, local edits and reruns generate normally.
60+
# Requires a caller checkout and actions: read plus contents: read to inspect history; missing access falls back to generation.
61+
# Invoke after required checks on every default-branch push; additional job/path filters can hide pending documentation changes.
62+
# Keep this list aligned with custom templates. For example:
63+
# application/
64+
# docs/
65+
# e2e/
66+
# README.md
67+
# See [the decision](../../../docs/adr/0011-skip-unchanged-helm-documentation.md) for safety and recovery behavior.
68+
skip-if-only-changed: ""
69+
5670
# Merge strategy for the documentation pull request: `merge`, `rebase`, or `squash`.
5771
# Use `squash` for branches requiring signed commits and enable squash merging in the repository settings.
5872
#
@@ -82,24 +96,36 @@ Mainly using [losisin/helm-docs-github-action](https://github.com/losisin/helm-d
8296
8397
## Inputs
8498
85-
| **Input** | **Description** | **Required** | **Default** |
86-
| -------------------------- | -------------------------------------------------------------------------------------------------------- | ------------ | ------------------------- |
87-
| **`working-directory`** | Working directory | **false** | `${{ github.workspace }}` |
88-
| **`checkout-ref`** | The Git ref to checkout before generating documentation. | **false** | `${{ github.ref }}` |
89-
| | Can be a branch, tag or commit SHA. | | |
90-
| | Set to an empty string to skip checkout. | | |
91-
| **`values-file`** | Path to the values file to use for generating the documentation. | **false** | - |
92-
| | See <https://github.com/losisin/helm-values-schema-json-action>. | | |
93-
| **`merge-method`** | Merge strategy for the documentation pull request: `merge`, `rebase`, or `squash`. | **false** | `rebase` |
94-
| | Use `squash` for branches requiring signed commits and enable squash merging in the repository settings. | | |
95-
| **`github-token`** | GitHub Token to create and merge pull request. | **false** | `${{ github.token }}` |
96-
| | Permissions: | | |
97-
| | - contents: write | | |
98-
| | - pull-requests: write | | |
99-
| **`github-app-client-id`** | GitHub App client ID to generate GitHub token in place of github-token. | **false** | - |
100-
| | See <https://github.com/actions/create-github-app-token>. | | |
101-
| **`github-app-key`** | GitHub App private key to generate GitHub token in place of github-token. | **false** | - |
102-
| | See <https://github.com/actions/create-github-app-token>. | | |
99+
| **Input** | **Description** | **Required** | **Default** |
100+
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------- |
101+
| **`working-directory`** | Working directory | **false** | `${{ github.workspace }}` |
102+
| **`checkout-ref`** | The Git ref to checkout before generating documentation. | **false** | `${{ github.ref }}` |
103+
| | Can be a branch, tag or commit SHA. | | |
104+
| | Set to an empty string to skip checkout. | | |
105+
| **`values-file`** | Path to the values file to use for generating the documentation. | **false** | - |
106+
| | See <https://github.com/losisin/helm-values-schema-json-action>. | | |
107+
| **`skip-if-only-changed`** | Optional newline-separated repository-relative files or directories whose changes cannot affect chart documentation. | **false** | - |
108+
| | Paths are literal, and directories must end with a slash. Empty keeps generation unconditional. | | |
109+
| | On the first attempt of a default-branch push, skip only when every change since the same workflow's last successful push is listed. | | |
110+
| | Chart search paths and the explicit values file always require generation. Missing history, API/Git uncertainty, local edits and reruns generate normally. | | |
111+
| | Requires a caller checkout and actions: read plus contents: read to inspect history; missing access falls back to generation. | | |
112+
| | Invoke after required checks on every default-branch push; additional job/path filters can hide pending documentation changes. | | |
113+
| | Keep this list aligned with custom templates. For example: | | |
114+
| | application/ | | |
115+
| | docs/ | | |
116+
| | e2e/ | | |
117+
| | README.md | | |
118+
| | See [the decision](../../../docs/adr/0011-skip-unchanged-helm-documentation.md) for safety and recovery behavior. | | |
119+
| **`merge-method`** | Merge strategy for the documentation pull request: `merge`, `rebase`, or `squash`. | **false** | `rebase` |
120+
| | Use `squash` for branches requiring signed commits and enable squash merging in the repository settings. | | |
121+
| **`github-token`** | GitHub Token to create and merge pull request. | **false** | `${{ github.token }}` |
122+
| | Permissions: | | |
123+
| | - contents: write | | |
124+
| | - pull-requests: write | | |
125+
| **`github-app-client-id`** | GitHub App client ID to generate GitHub token in place of github-token. | **false** | - |
126+
| | See <https://github.com/actions/create-github-app-token>. | | |
127+
| **`github-app-key`** | GitHub App private key to generate GitHub token in place of github-token. | **false** | - |
128+
| | See <https://github.com/actions/create-github-app-token>. | | |
103129

104130
<!-- inputs:end -->
105131

0 commit comments

Comments
 (0)