build(deps): bump golang version from 1.26.2 to 1.26.3 (#420) #690
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: taskfile-without-empty-lines | |
| "on": | |
| push: | |
| permissions: | |
| contents: read | |
| jobs: | |
| taskfile-without-empty-lines: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - run: | | |
| yaml_file="./build/task.yml" | |
| empty_lines=$(grep -n -e '^$' "$yaml_file") | |
| awk ' | |
| BEGIN { | |
| in_block = 0; | |
| empty_line_found = 0; | |
| impacted_lines = ""; | |
| } | |
| /^[[:space:]]*- *\|[[:space:]]*$/ { | |
| in_block = 1; | |
| next; | |
| } | |
| /^$/ { | |
| if (in_block == 0) { | |
| empty_line_found = 1; | |
| impacted_lines = impacted_lines NR ", "; | |
| } | |
| } | |
| { | |
| # Exit the block if a non-indented line is encountered | |
| if (in_block == 1 && match($0, /^[^[:space:]]/)) { | |
| in_block = 0; | |
| } | |
| } | |
| END { | |
| if (empty_line_found == 1) { | |
| # Remove the last comma and space from the string | |
| sub(/, $/, "", impacted_lines); | |
| print "Empty lines found at lines: " impacted_lines; | |
| exit 1; | |
| } | |
| } | |
| ' "$yaml_file" | |
| exit_status=$? | |
| if [[ $exit_status -ne 0 ]]; then | |
| echo "❌ Empty lines outside of '- |' blocks, found in $yaml_file:" | |
| exit 1 | |
| fi | |
| echo "✅ $yaml_file is without empty lines!" |