diff --git a/.github/workflows/about-postmerge-release.yml b/.github/workflows/about-postmerge-release.yml new file mode 100644 index 0000000..d554754 --- /dev/null +++ b/.github/workflows/about-postmerge-release.yml @@ -0,0 +1,227 @@ +name: About Post-Merge Release + +on: + push: + branches: [main] + +permissions: + contents: write + pull-requests: write + +jobs: + release: + if: contains(github.event.head_commit.message, 'premium bilingual About') || contains(github.event.head_commit.message, 'About / Trust') || contains(github.event.head_commit.message, 'About trust') + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Apply final production fixes + shell: bash + run: | + set -euo pipefail + git config user.name "Financial Stream Release" + git config user.email "actions@users.noreply.github.com" + + # Restore the stable production JavaScript from pre-merge main. + git show HEAD^1:assets/js/site.js > assets/js/site.js + rm -f assets/js/site-core.js + + python3 - <<'PY' + from pathlib import Path + import re + + def clean_about(path): + p=Path(path); s=p.read_text(encoding='utf-8') + s=re.sub(r'.*?','',s,flags=re.S) + s=re.sub(r'\s*(?:Company principle|Принцип работы компании).*?','',s,flags=re.S) + for phrase in [ + 'Company principle. This space can later be replaced with Tetiana’s approved personal wording.', + 'Company principle. This is not presented as a personal quotation.', + 'Принцип работы компании. Текст не оформлен как личная цитата.', + 'Позже этот блок можно заменить' + ]: s=s.replace(phrase,'') + p.write_text(s,encoding='utf-8') + + clean_about('about/index.html') + clean_about('ru/about/index.html') + + def home(path,href,label,services,service_label,nav_title): + p=Path(path); s=p.read_text(encoding='utf-8') + anchor=f'{label}' + service=f'{service_label}' + if s.count(anchor)<2: + s=s.replace(service,service+'\n '+anchor,2) + marker=f'\n