Bump k8s to v1.35 for pre-release test #2733
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: yamllint | |
| on: | |
| pull_request: | |
| types: [ opened, edited, synchronize, reopened ] | |
| workflow_call: | |
| inputs: | |
| ignore-paths: | |
| required: false | |
| description: "Comma-separated list of paths to ignore when extracting YAML snippets from Markdown files (e.g., './docs/examples/*,./test/*')" | |
| type: string | |
| default: "" | |
| ref: | |
| required: false | |
| description: "Git reference of the workflow's trigger" | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install yamllint | |
| run: sudo apt-get update && sudo apt-get install -y yamllint | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Extract YAML snippets from md files | |
| run: | | |
| set -euo pipefail | |
| mkdir -p .yaml-snippet | |
| # Build find command with ignore paths using array | |
| FIND_ARGS=(. -name "*.md" -not -path "./.git/*") | |
| # Add ignore paths if provided | |
| if [[ -n "${{ inputs.ignore-paths || '' }}" ]]; then | |
| IFS=',' read -ra IGNORE_PATHS <<< "${{ inputs.ignore-paths || '' }}" | |
| for path in "${IGNORE_PATHS[@]}"; do | |
| path=$(echo "${path}" | xargs) | |
| if [[ -n "${path}" ]]; then | |
| FIND_ARGS+=(-not -path "${path}") | |
| fi | |
| done | |
| fi | |
| # Process each md file | |
| while IFS= read -r md_file; do | |
| echo "Processing: ${md_file}" | |
| # Get safe filename based on full path | |
| safe_name=$(echo "${md_file}" | sed 's/[\/\.]/_/g') | |
| # Extract YAML code blocks and save each one | |
| awk -v base="${safe_name}" ' | |
| BEGIN { count=0 } | |
| /^```(yaml|yml)/ { in_block=1; next } | |
| /^```/ && in_block { | |
| if (block != "") { | |
| count++ | |
| file = sprintf(".yaml-snippet/%s_snippet_%03d.yaml", base, count) | |
| print block > file | |
| close(file) | |
| block = "" | |
| } | |
| in_block=0 | |
| next | |
| } | |
| in_block { block = (block == "" ? $0 : block "\n" $0) } | |
| ' "${md_file}" | |
| done < <(find "${FIND_ARGS[@]}") | |
| echo "Extracted $(ls -1 .yaml-snippet/*.yaml 2>/dev/null | wc -l) YAML snippet(s)" | |
| - name: yaml-lint | |
| uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1 | |
| with: | |
| config_file: .yamllint.yaml | |
| - name: yaml-lint for md snippets | |
| uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1 | |
| with: | |
| config_file: .yamllint.yaml | |
| file_or_dir: .yaml-snippet/ | |
| strict: true |