diff --git a/.github/workflows/krel-release-notes-validate.yaml b/.github/workflows/krel-release-notes-validate.yaml index 717761292ec..28adfcee2a2 100644 --- a/.github/workflows/krel-release-notes-validate.yaml +++ b/.github/workflows/krel-release-notes-validate.yaml @@ -14,12 +14,6 @@ name: Yaml Lint Release Notes on: - push: - branches: - - master - paths: - - releases/**/release-notes/**.yaml - - releases/**/release-notes/**.yml pull_request: paths: - releases/**/release-notes/**.yaml @@ -27,9 +21,12 @@ on: # Allow manual triggering workflow_dispatch: { } +permissions: { } + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + jobs: krel_release_notes_validate_action: name: Validate release notes with krel @@ -39,8 +36,7 @@ jobs: - name: Check out code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: - # we need to fetch the full history in order to check changes across all commits on the branch - fetch-depth: '0' + fetch-depth: 0 - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version: '1.23' @@ -95,46 +91,36 @@ jobs: CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- releases/ | grep -E '\.ya?ml$' || true) if [ -n "$CHANGED_FILES" ]; then - echo "validating base sha ${{ github.event.pull_request.base.sha }}" + echo "### YAML Validation Results :mag:" >> $GITHUB_STEP_SUMMARY + echo "Validating files against base SHA: ${{ github.event.pull_request.base.sha }}" >> $GITHUB_STEP_SUMMARY - # Initialize an array for invalid files INVALID_FILES="" while IFS= read -r file; do + echo "#### Validating: ${file##*/}" >> $GITHUB_STEP_SUMMARY set +e - "${KREL_PATH}" release-notes validate --path-to-release-notes "$file" + VALIDATION_OUTPUT=$("${KREL_PATH}" release-notes validate --path-to-release-notes "$file" 2>&1) exit_code=$? set -e - + if [ $exit_code -ne 0 ]; then INVALID_FILES="${INVALID_FILES}- ${file##*/}\n" + echo "❌ Validation failed with the following errors:" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + echo "$VALIDATION_OUTPUT" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + else + echo "✅ File is valid" >> $GITHUB_STEP_SUMMARY fi done <<< "$CHANGED_FILES" - # If there are any invalid files, set the output and fail if [ -n "$INVALID_FILES" ]; then - echo "invalid_files<> $GITHUB_OUTPUT - echo -e "$INVALID_FILES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + echo -e "\n### ❌ Validation Failed" >> $GITHUB_STEP_SUMMARY + echo "The following files contain invalid YAML:" >> $GITHUB_STEP_SUMMARY + echo -e "$INVALID_FILES" >> $GITHUB_STEP_SUMMARY exit 1 - else - echo "All YAML files are valid." fi else - echo "No YAML files changed under /releases/*" + echo "### No YAML Changes Detected" >> $GITHUB_STEP_SUMMARY + echo "No YAML files were changed under /releases/*" >> $GITHUB_STEP_SUMMARY fi - - name: Comment on PR if invalid yaml detected - if: failure() && github.event_name == 'pull_request' - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const invalidFiles = `${{ steps.validate_releases_yaml.outputs.invalid_files }}`; - if (invalidFiles) { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `❌ YAML validation failed for the following files:\n\n${invalidFiles}` - }); - } \ No newline at end of file diff --git a/releases/release-1.31/release-notes/maps/pr-112104-map.yaml b/releases/release-1.31/release-notes/maps/pr-112104-map.yaml index 3c9e0c5b1a0..97495ff0dee 100644 --- a/releases/release-1.31/release-notes/maps/pr-112104-map.yaml +++ b/releases/release-1.31/release-notes/maps/pr-112104-map.yaml @@ -1,5 +1,5 @@ pr: 112104 releasenote: text: Fixed EDITOR/KUBE_EDITOR with double-quoted paths with spaces when on Windows - cmd.exe. +cmd.exe. pr_body: "" diff --git a/releases/release-1.31/release-notes/maps/pr-118148-map.yaml b/releases/release-1.31/release-notes/maps/pr-118148-map.yaml index 9f1f4da183e..7efd8dd176b 100644 --- a/releases/release-1.31/release-notes/maps/pr-118148-map.yaml +++ b/releases/release-1.31/release-notes/maps/pr-118148-map.yaml @@ -1,5 +1,6 @@ pr: 118148 releasenote: text: Exposed the kube-scheduler "/livez" and "/readz" endpoints for health checks - that are in compliance with https://kubernetes.io/docs/reference/using-api/health-checks/#api-endpoints-for-health. + that are in compliance with https://kubernetes.io/docs/reference/using-api/health + -checks/#api-endpoints-for-health. pr_body: "" diff --git a/releases/release-1.31/release-notes/maps/pr-124017-map.yaml b/releases/release-1.31/release-notes/maps/pr-124017-map.yaml index 5cd4d3d78d0..8e87046c65f 100644 --- a/releases/release-1.31/release-notes/maps/pr-124017-map.yaml +++ b/releases/release-1.31/release-notes/maps/pr-124017-map.yaml @@ -2,5 +2,5 @@ pr: 124017 releasenote: text: | Removed deprecated command flags --volume-host-cidr-denylist - and --volume-host-allow-local-loopback from kube-controller-manager. + and --volume-host-allow-local-loopback from kube-controller-manager.