Skip to content

Commit

Permalink
GDB-9455: Added automatic readme generation with helm-docs
Browse files Browse the repository at this point in the history
- Added readme Go template used as a base for generating the readme with helm-docs
- Added new workflow that invokes helm-docs and pushes changes back to the PR
  • Loading branch information
mihailradkov committed Mar 19, 2024
1 parent 4fc137c commit fcc7edc
Show file tree
Hide file tree
Showing 2 changed files with 493 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Continuous Integration

on:
pull_request:

env:
HELM_DOCS_IMAGE: "jnorwood/helm-docs:v1.13.1@sha256:717bd8f770bd1d25ccf79c876f1420e105832f2d6bbde12170405f58f540cb2d"

jobs:
documentation:
name: Generate readme
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- id: checkout_repository
name: Checkout repository
# actions/checkout@v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: ${{ github.event.pull_request.head.ref }}

- id: generate_helm_docs
name: Generate Helm chart readme with helm-docs
run: |
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" $HELM_DOCS_IMAGE
- id: update_pull_request
name: Update PR with readme changes
run: |
if ! git diff --exit-code; then
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "Updated the README"
git push
else
echo "Readme is up to date, nothing to push..."
fi
Loading

0 comments on commit fcc7edc

Please sign in to comment.