Skip to content

Commit aa93a4e

Browse files
committed
feat(actions/helm/generate-docs): add checkout-ref input to skip Git checkout in Helm documentation generation
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent d26a54c commit aa93a4e

2 files changed

Lines changed: 32 additions & 14 deletions

File tree

actions/helm/generate-docs/README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ Mainly using [losisin/helm-docs-github-action](https://github.com/losisin/helm-d
4141
# Default: `${{ github.workspace }}`
4242
working-directory: ${{ github.workspace }}
4343

44+
# The git ref to checkout before generating documentation.
45+
# Can be a branch, tag or commit SHA.
46+
# Set to an empty string to skip checkout.
47+
# Default: `${{ github.ref }}`
48+
checkout-ref: ${{ github.ref }}
49+
4450
# Path to the values file to use for generating the documentation.
4551
# See https://github.com/losisin/helm-values-schema-json-action.
4652
values-file: ""
@@ -68,19 +74,21 @@ Mainly using [losisin/helm-docs-github-action](https://github.com/losisin/helm-d
6874
6975
## Inputs
7076
71-
| **Input** | **Description** | **Required** | **Default** |
72-
| -------------------------- | ------------------------------------------------------------------------- | ------------ | ------------------------- |
73-
| **`working-directory`** | Working directory | **false** | `${{ github.workspace }}` |
74-
| **`values-file`** | Path to the values file to use for generating the documentation. | **false** | - |
75-
| | See <https://github.com/losisin/helm-values-schema-json-action>. | | |
76-
| **`github-token`** | GitHub Token to create and merge pull request. | **false** | `${{ github.token }}` |
77-
| | Permissions: | | |
78-
| | - contents: write | | |
79-
| | - pull-requests: write | | |
80-
| **`github-app-client-id`** | GitHub App client ID to generate GitHub token in place of github-token. | **false** | - |
81-
| | See <https://github.com/actions/create-github-app-token>. | | |
82-
| **`github-app-key`** | GitHub App private key to generate GitHub token in place of github-token. | **false** | - |
83-
| | See <https://github.com/actions/create-github-app-token>. | | |
77+
| **Input** | **Description** | **Required** | **Default** |
78+
| -------------------------- | ---------------------------------------------------------------------------- | ------------ | ------------------------- |
79+
| **`working-directory`** | Working directory | **false** | `${{ github.workspace }}` |
80+
| **`checkout-ref`** | The Git ref to checkout before generating documentation. | **false** | `${{ github.ref }}` |
81+
| | Can be a branch, tag or commit SHA. Set to an empty string to skip checkout. | | |
82+
| **`values-file`** | Path to the values file to use for generating the documentation. | **false** | - |
83+
| | See <https://github.com/losisin/helm-values-schema-json-action>. | | |
84+
| **`github-token`** | GitHub Token to create and merge pull request. | **false** | `${{ github.token }}` |
85+
| | Permissions: | | |
86+
| | - contents: write | | |
87+
| | - pull-requests: write | | |
88+
| **`github-app-client-id`** | GitHub App client ID to generate GitHub token in place of github-token. | **false** | - |
89+
| | See <https://github.com/actions/create-github-app-token>. | | |
90+
| **`github-app-key`** | GitHub App private key to generate GitHub token in place of github-token. | **false** | - |
91+
| | See <https://github.com/actions/create-github-app-token>. | | |
8492

8593
<!-- inputs:end -->
8694

actions/helm/generate-docs/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ inputs:
1414
description: "Working directory"
1515
required: false
1616
default: "${{ github.workspace }}"
17+
checkout-ref:
18+
description: |
19+
The Git ref to checkout before generating documentation.
20+
Can be a branch, tag or commit SHA.
21+
Set to an empty string to skip checkout.
22+
required: false
23+
default: ${{ github.ref }}
1724
values-file:
1825
description: |
1926
Path to the values file to use for generating the documentation.
@@ -129,7 +136,10 @@ runs:
129136
}
130137
core.setOutput("markdownlint-config-path", markdownlintConfigPath);
131138
132-
- uses: hoverkraft-tech/ci-github-common/actions/checkout@b553a696531fbd36743ccbb0c76c717971b8acdb # 0.35.4
139+
- if: ${{ inputs.checkout-ref != '' }}
140+
uses: hoverkraft-tech/ci-github-common/actions/checkout@b553a696531fbd36743ccbb0c76c717971b8acdb # 0.35.4
141+
with:
142+
ref: ${{ inputs.checkout-ref }}
133143

134144
- uses: losisin/helm-docs-github-action@3a4528e97c49a5e83de6b78c50c61c8ee5c9f944 # v2.0.0
135145
with:

0 commit comments

Comments
 (0)