|
| 1 | +--- |
| 2 | +name: "Helm - Generate Chart Documentation" |
| 3 | +description: | |
| 4 | + Action to generate documentation for a Helm chart. |
| 5 | + It will generate the documentation in the `docs/` directory of the chart. |
| 6 | + Mainly using [losisin/helm-docs-github-action](https://github.com/losisin/helm-docs-github-action). |
| 7 | +author: Hoverkraft |
| 8 | +branding: |
| 9 | + icon: book-open |
| 10 | + color: blue |
| 11 | + |
| 12 | +inputs: |
| 13 | + working-directory: |
| 14 | + description: "Working directory" |
| 15 | + required: false |
| 16 | + default: "${{ github.workspace }}" |
| 17 | + github-token: |
| 18 | + description: | |
| 19 | + GitHub Token to create and merge pull request. |
| 20 | + Permissions: |
| 21 | + - contents: write |
| 22 | + - pull-requests: write |
| 23 | + default: ${{ github.token }} |
| 24 | + github-app-id: |
| 25 | + description: | |
| 26 | + GitHub App ID to generate GitHub token in place of github-token. |
| 27 | + See <https://github.com/actions/create-github-app-token>. |
| 28 | + required: false |
| 29 | + github-app-key: |
| 30 | + description: | |
| 31 | + GitHub App private key to generate GitHub token in place of github-token. |
| 32 | + See <https://github.com/actions/create-github-app-token>. |
| 33 | + required: false |
| 34 | + |
| 35 | +runs: |
| 36 | + using: "composite" |
| 37 | + steps: |
| 38 | + - shell: bash |
| 39 | + id: prepare-variables |
| 40 | + run: | |
| 41 | + echo "working-directory-name=$(basename "${{ inputs.working-directory }}")" >> "$GITHUB_OUTPUT" |
| 42 | +
|
| 43 | + - uses: hoverkraft-tech/ci-github-common/actions/checkout@9a3d71ca9f68bc1061db8ea1442084ac31a0f8bf # 0.23.0 |
| 44 | + |
| 45 | + - uses: losisin/helm-docs-github-action@8dc2304e986afbbb0b7db0a9980b6bf68c1307cf # v1.5.2 |
| 46 | + with: |
| 47 | + chart-search-root: ${{ inputs.working-directory }} |
| 48 | + |
| 49 | + - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 |
| 50 | + if: inputs.github-app-id |
| 51 | + id: generate-token |
| 52 | + with: |
| 53 | + app-id: ${{ inputs.github-app-id }} |
| 54 | + private-key: ${{ inputs.github-app-key }} |
| 55 | + |
| 56 | + - uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@9a3d71ca9f68bc1061db8ea1442084ac31a0f8bf # 0.23.0 |
| 57 | + with: |
| 58 | + github-token: ${{ steps.generate-token.outputs.token || inputs.github-token }} |
| 59 | + branch: docs/update-helm-chart-docs-${{ steps.prepare-variables.outputs.working-directory-name }} |
| 60 | + title: "docs: update Helm chart documentation for ${{ steps.prepare-variables.outputs.working-directory-name }}" |
| 61 | + body: | |
| 62 | + This pull request updates the documentation for the Helm chart `${{ steps.prepare-variables.outputs.working-directory-name }}`. |
| 63 | + commit-message: | |
| 64 | + docs: update Helm chart documentation for ${{ steps.prepare-variables.outputs.working-directory-name }} |
| 65 | +
|
| 66 | + [skip ci] |
0 commit comments