Skip to content

Commit 90e6e47

Browse files
ilyazubCopilot
andcommitted
Fix YAML syntax error in release workflow: use shell: python3 instead of heredoc
The Python heredoc body started at column 0, causing YAML to terminate the run: literal block early and fail to parse. Use shell: python3 {0} to run the verification step as a native Python script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 513988d commit 90e6e47

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ jobs:
129129
- name: Verify import and version
130130
env:
131131
API_KEY: ${{ secrets.API_KEY }}
132+
EXPECTED_VERSION: ${{ github.ref_name }}
133+
shell: python3 {0}
132134
run: |
133-
VERSION=${GITHUB_REF_NAME#v}
134-
python - <<PY
135-
import os
136-
import serpapi
137-
assert serpapi.__version__ == '$VERSION', f'Version mismatch: {serpapi.__version__} != $VERSION'
138-
print(f'OK: serpapi=={serpapi.__version__} installed successfully')
139-
client = serpapi.Client(api_key=os.environ["API_KEY"])
140-
results = client.search({"engine": "google", "q": "coffee"})
141-
assert results.get("organic_results"), "No organic results returned"
142-
print(f'OK: live search returned {len(results["organic_results"])} organic results')
143-
PY
135+
import os
136+
import serpapi
137+
expected = os.environ["EXPECTED_VERSION"].lstrip("v")
138+
assert serpapi.__version__ == expected, f"Version mismatch: {serpapi.__version__} != {expected}"
139+
print(f"OK: serpapi=={serpapi.__version__} installed successfully")
140+
client = serpapi.Client(api_key=os.environ["API_KEY"])
141+
results = client.search({"engine": "google", "q": "coffee"})
142+
assert results.get("organic_results"), "No organic results returned"
143+
print(f"OK: live search returned {len(results['organic_results'])} organic results")

0 commit comments

Comments
 (0)