Skip to content

Commit a48f79c

Browse files
authored
fix: use POSIX ERE [0-9] instead of \d in grep patterns for version discovery (#168)
The "Discover all versions" step in `publish-documentation.yml` used `\d` in grep ERE patterns, which is not supported in POSIX ERE on Ubuntu 24.04. This caused `grep` to return exit code 1 (no matches), failing the step under `pipefail`. ## Change - Replace `\d` with `[0-9]` in both grep patterns in the `Discover all versions` step: ```diff - versions=$(ls api-reference/ | grep -E '^\d+\.\d+$' | sort -V | paste -sd ',' -) - latest=$(ls api-reference/ | grep -E '^\d+\.\d+$' | sort -V | tail -1) + versions=$(ls api-reference/ | grep -E '^[0-9]+\.[0-9]+$' | sort -V | paste -sd ',' -) + latest=$(ls api-reference/ | grep -E '^[0-9]+\.[0-9]+$' | sort -V | tail -1) ``` `\d` requires `grep -P` (PCRE); POSIX ERE (`-E`) only recognises `[0-9]`.
1 parent bb09d9f commit a48f79c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/publish-documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100
id: discover-versions
101101
shell: bash
102102
run: |
103-
versions=$(ls api-reference/ | grep -E '^\d+\.\d+$' | sort -V | paste -sd ',' -)
104-
latest=$(ls api-reference/ | grep -E '^\d+\.\d+$' | sort -V | tail -1)
103+
versions=$(ls api-reference/ | grep -E '^[0-9]+\.[0-9]+$' | sort -V | paste -sd ',' -)
104+
latest=$(ls api-reference/ | grep -E '^[0-9]+\.[0-9]+$' | sort -V | tail -1)
105105
echo "versions=$versions" >> $GITHUB_OUTPUT
106106
echo "latest=$latest" >> $GITHUB_OUTPUT
107107

0 commit comments

Comments
 (0)