Skip to content

Commit 03031d9

Browse files
committed
fix: avoid heredoc parsing issue in tag version guard
1 parent 39888c8 commit 03031d9

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

.github/workflows/distribution-check.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,13 @@ jobs:
3333
run: |
3434
set -euo pipefail
3535
36-
read -r VERSION SOURCE_TAG < <(
37-
python3 - <<'PY'
38-
import pathlib
39-
import re
40-
41-
text = pathlib.Path("CocoaMQTT.podspec").read_text(encoding="utf-8")
42-
version = re.search(r's\.version\s*=\s*"([^"]+)"', text)
43-
source_tag = re.search(r':tag\s*=>\s*"([^"]+)"', text)
44-
if not version or not source_tag:
45-
raise SystemExit("Failed to parse version or source tag from CocoaMQTT.podspec")
46-
print(version.group(1), source_tag.group(1))
47-
PY
48-
)
36+
VERSION="$(ruby -ne 'puts $1 if /s\.version\s*=\s*"([^"]+)"/' CocoaMQTT.podspec)"
37+
SOURCE_TAG="$(ruby -ne 'puts $1 if /:tag\s*=>\s*"([^"]+)"/' CocoaMQTT.podspec)"
38+
39+
if [ -z "${VERSION}" ] || [ -z "${SOURCE_TAG}" ]; then
40+
echo "Failed to parse version or source tag from CocoaMQTT.podspec"
41+
exit 1
42+
fi
4943
5044
if [ "${VERSION}" != "${SOURCE_TAG}" ]; then
5145
echo "podspec version (${VERSION}) must match source tag (${SOURCE_TAG})"

0 commit comments

Comments
 (0)