caterium-app/.github/workflows/hotfix-v1769-idempotent.yml
2026-09-08 08:18:23 +03:00

37 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Hotfix v17.6.9 offer workspace idempotency
on:
push:
branches:
- feature/v17.6.9-offer-pdf-tabs-gallery
permissions:
contents: write
jobs:
patch:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: feature/v17.6.9-offer-pdf-tabs-gallery
- name: Make offer tab rendering idempotent
shell: bash
run: |
python - <<'PY'
from pathlib import Path
p=Path('public/core/offer-workspace-v1769.js')
s=p.read_text()
old="const edit=$('sunOfferEdit');if(edit){edit.textContent=mode==='editor'?'К просмотру':'Редактировать';edit.setAttribute('aria-pressed',mode==='editor'?'true':'false')}"
new="const edit=$('sunOfferEdit');if(edit){const label=mode==='editor'?'К просмотру':'Редактировать';if(edit.textContent!==label)edit.textContent=label;edit.setAttribute('aria-pressed',mode==='editor'?'true':'false')}"
if old not in s:
raise SystemExit('target not found')
p.write_text(s.replace(old,new,1))
PY
- name: Commit hotfix
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add public/core/offer-workspace-v1769.js
git commit -m "Make v17.6.9 offer workspace rendering idempotent"
git push origin HEAD:feature/v17.6.9-offer-pdf-tabs-gallery