From 2194c89cd10c53407eb14c9281e456926fd589c4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 03:00:07 +0000 Subject: [PATCH 1/2] Initial plan From 4f96cb2bb09649a86bfc67fa05df97d902c21194 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 03:06:11 +0000 Subject: [PATCH 2/2] Fix deploy-gh-pages workflow: extract inline Python to separate script The workflow YAML was invalid because the Python heredoc contained a multi-line HTML string with lines starting at column 1, breaking out of the YAML literal block scalar (run: |). This caused GitHub Actions to fail with 0 jobs in 0s. Fix: Move the build logic into scripts/build-gh-pages.py and call it from the workflow step. Co-authored-by: stev4501 <34610768+stev4501@users.noreply.github.com> Agent-Logs-Url: https://github.com/stev4501/Hormone-experts/sessions/c533b682-3119-418b-8e42-09559a5a8a65 --- .github/workflows/deploy-gh-pages.yml | 52 +-------------------------- .gitignore | 1 + scripts/build-gh-pages.py | 49 +++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 scripts/build-gh-pages.py diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 43ea5a2..50441e9 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -15,57 +15,7 @@ jobs: - uses: actions/checkout@v4 - name: Build static index.html from Select-product-page.jsx - run: | - python3 - << 'PYEOF' - import re, os - - with open('Select-product-page.jsx', 'r') as f: - content = f.read() - - # Replace ES module import with global React reference using regex - # to handle variations in whitespace or quote style - component_code = re.sub( - r'''import\s*\{\s*useState\s*\}\s*from\s*['"]react['"];?''', - 'const { useState } = React;', - content - ) - # Remove export default so MensHealthCombined is a plain function in browser scope - component_code = re.sub( - r'\bexport\s+default\s+function\s+', - 'function ', - component_code - ) - - html = """ - - - - - Hormone Experts – Men's Health - - - - - - -
- - - -""" - - os.makedirs('gh-pages-dist', exist_ok=True) - with open('gh-pages-dist/index.html', 'w') as f: - f.write(html) - - print(f"Generated gh-pages-dist/index.html ({len(html)} bytes)") - PYEOF + run: python3 scripts/build-gh-pages.py - name: Deploy to gh-pages branch uses: peaceiris/actions-gh-pages@v3.9.3 diff --git a/.gitignore b/.gitignore index 9a5aced..5aed382 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,4 @@ dist # Vite logs files vite.config.js.timestamp-* vite.config.ts.timestamp-* +gh-pages-dist/ diff --git a/scripts/build-gh-pages.py b/scripts/build-gh-pages.py new file mode 100644 index 0000000..7b4d6ab --- /dev/null +++ b/scripts/build-gh-pages.py @@ -0,0 +1,49 @@ +import re +import os + +with open('Select-product-page.jsx', 'r') as f: + content = f.read() + +# Replace ES module import with global React reference using regex +# to handle variations in whitespace or quote style +component_code = re.sub( + r'''import\s*\{\s*useState\s*\}\s*from\s*['"]react['"];?''', + 'const { useState } = React;', + content +) +# Remove export default so MensHealthCombined is a plain function in browser scope +component_code = re.sub( + r'\bexport\s+default\s+function\s+', + 'function ', + component_code +) + +html = """ + + + + + Hormone Experts \u2013 Men's Health + + + + + + +
+ + + +""" + +os.makedirs('gh-pages-dist', exist_ok=True) +with open('gh-pages-dist/index.html', 'w') as f: + f.write(html) + +print(f"Generated gh-pages-dist/index.html ({len(html)} bytes)")