diff --git a/.github/workflows/hotfix-v1769-idempotent.yml b/.github/workflows/hotfix-v1769-idempotent.yml new file mode 100644 index 0000000..02f196a --- /dev/null +++ b/.github/workflows/hotfix-v1769-idempotent.yml @@ -0,0 +1,36 @@ +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