name: Generate helm docs run-name: Generate helm docs ${{ github.ref_name }} by @${{ github.actor }}" on: pull_request: paths: - "deployment/helm_chart/opik/**" types: [opened, synchronize, reopened, labeled] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: update-readme: runs-on: ubuntu-latest timeout-minutes: 5 permissions: contents: write steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.ref }} # If the PR has the "update readme" label, generate and commit - name: Generate and commit helm docs if: contains(github.event.pull_request.labels.*.name, 'update readme') uses: losisin/helm-docs-github-action@v1 with: chart-search-root: deployment/helm_chart/opik git-push: true git-push-user-name: "CometActions" git-push-user-email: "github-actions@comet.com" git-commit-message: "Update Helm documentation" # If the PR does NOT have the label, just validate that docs are up-to-date - name: Validate helm docs are up-to-date if: "!contains(github.event.pull_request.labels.*.name, 'update readme')" uses: losisin/helm-docs-github-action@v1 with: chart-search-root: deployment/helm_chart/opik git-push: false - name: Check for uncommitted helm docs changes if: "!contains(github.event.pull_request.labels.*.name, 'update readme')" run: | if [ -n "$(git status --porcelain)" ]; then echo "::error::Helm docs are out of date. Please run 'pre-commit run helm-docs --all-files' locally and commit the changes, or add the 'update readme' label to this PR and don't forget to update your local branch afterwards." git status --short exit 1 fi