We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfd00e7 commit fb8bba3Copy full SHA for fb8bba3
1 file changed
.github/workflows/release.yml
@@ -49,10 +49,11 @@ jobs:
49
id: version_check
50
run: |
51
BRANCH_VERSION="${{ env.VERSION }}"
52
-
53
- # Safely extract __version__ from the file (for example, '1.0.0' from __version__ = '1.0.0')
54
- CODE_VERSION=$(grep '__version__' src/docbuild/__about__.py | awk -F "'" '{print $2}')
55
+
+ # Safely extract __version__ from the file regardless of single or double quotes,
+ # e.g. __version__ = '1.0.0' or __version__ = "1.0.0"
+ CODE_VERSION=$(grep -Po "__version__\s*=\s*['\"]\K[^'\"]+" src/docbuild/__about__.py)
56
57
echo ":notice title=Branch version::$BRANCH_VERSION"
58
echo ":notice title=Code version::$CODE_VERSION"
59
0 commit comments