Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/__main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ jobs:
"test-build-args-secrets"
]

helm-docs:
needs: ci
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: ./actions/helm/generate-docs
with:
working-directory: ./tests/charts
github-app-id: ${{ vars.CI_BOT_APP_ID }}
github-app-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}

release:
needs: ci
if: github.event_name != 'schedule'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/__pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on: # yamllint disable-line rule:truthy

permissions:
actions: read
contents: read
contents: write
issues: read
packages: write
pull-requests: read
pull-requests: write
security-events: write
statuses: write
# FIXME: This is a workaround for having workflow actions. See https://github.com/orgs/community/discussions/38659
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Opinionated GitHub Actions and workflows for continuous integration in container

### Helm

#### - [Generate chart documentation](actions/helm/generate-docs/README.md)

#### - [Parse chart URI](actions/helm/parse-chart-uri/README.md)

#### - [Release chart](actions/helm/release-chart/README.md)
Expand Down
24 changes: 24 additions & 0 deletions actions/helm/generate-docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- start title -->
<!-- end title -->
<!--
// jscpd:ignore-start
-->
<!-- markdownlint-disable MD013 -->
<!-- start badges -->
<!-- end badges -->
<!-- markdownlint-enable MD013 -->
<!--
// jscpd:ignore-end
-->
<!-- start description -->
<!-- end description -->
<!-- start contents -->
<!-- end contents -->
<!-- start usage -->
<!-- end usage -->
<!-- start inputs -->
<!-- end inputs -->
<!-- start outputs -->
<!-- end outputs -->
<!-- start [.github/ghadocs/examples/] -->
<!-- end [.github/ghadocs/examples/] -->
66 changes: 66 additions & 0 deletions actions/helm/generate-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: "Helm - Generate Chart Documentation"
description: |
Action to generate documentation for a Helm chart.
It will generate the documentation in the `docs/` directory of the chart.
Mainly using [losisin/helm-docs-github-action](https://github.com/losisin/helm-docs-github-action).
author: Hoverkraft
branding:
icon: book-open
color: blue

inputs:
working-directory:
description: "Working directory"
required: false
default: "${{ github.workspace }}"
github-token:
description: |
GitHub Token to create and merge pull request.
Permissions:
- contents: write
- pull-requests: write
default: ${{ github.token }}
github-app-id:
description: |
GitHub App ID to generate GitHub token in place of github-token.
See <https://github.com/actions/create-github-app-token>.
required: false
github-app-key:
description: |
GitHub App private key to generate GitHub token in place of github-token.
See <https://github.com/actions/create-github-app-token>.
required: false

runs:
using: "composite"
steps:
- shell: bash
id: prepare-variables
run: |
echo "working-directory-name=$(basename "${{ inputs.working-directory }}")" >> "$GITHUB_OUTPUT"

- uses: hoverkraft-tech/ci-github-common/actions/checkout@9a3d71ca9f68bc1061db8ea1442084ac31a0f8bf # 0.23.0

- uses: losisin/helm-docs-github-action@8dc2304e986afbbb0b7db0a9980b6bf68c1307cf # v1.5.2
with:
chart-search-root: ${{ inputs.working-directory }}

- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
if: inputs.github-app-id
id: generate-token
with:
app-id: ${{ inputs.github-app-id }}
private-key: ${{ inputs.github-app-key }}

- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@9a3d71ca9f68bc1061db8ea1442084ac31a0f8bf # 0.23.0
with:
github-token: ${{ steps.generate-token.outputs.token || inputs.github-token }}
branch: docs/update-helm-chart-docs-${{ steps.prepare-variables.outputs.working-directory-name }}
title: "docs: update Helm chart documentation for ${{ steps.prepare-variables.outputs.working-directory-name }}"
body: |
This pull request updates the documentation for the Helm chart `${{ steps.prepare-variables.outputs.working-directory-name }}`.
commit-message: |
docs: update Helm chart documentation for ${{ steps.prepare-variables.outputs.working-directory-name }}

[skip ci]
2 changes: 1 addition & 1 deletion actions/helm/parse-chart-uri/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This action does not requires any permissions.

| **Input** | **Description** | **Default** | **Required** |
| ---------------- | ------------------ | ----------- | ------------ |
| <code>uri</code> | Chart URI to parse | | **true** |
| <code>URI</code> | Chart URI to parse | | **true** |

<!-- end inputs -->
<!-- start outputs -->
Expand Down