chore: add one-time branding repair
This commit is contained in:
parent
9290cc0103
commit
5c3ee9b679
46
.github/workflows/branding-repair-v1774.yml
vendored
Normal file
46
.github/workflows/branding-repair-v1774.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: Caterium One-Time Branding Repair
|
||||
on:
|
||||
push:
|
||||
branches: ["fix/caterium-branding-v1774"]
|
||||
permissions:
|
||||
contents: write
|
||||
concurrency:
|
||||
group: caterium-branding-repair-v1774
|
||||
cancel-in-progress: false
|
||||
jobs:
|
||||
repair:
|
||||
if: ${{ !contains(github.event.head_commit.message, '[branding-repair]') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: fix/caterium-branding-v1774
|
||||
fetch-depth: 0
|
||||
- name: Replace visible legacy branding
|
||||
shell: bash
|
||||
run: |
|
||||
node <<'NODE'
|
||||
const fs=require('fs');
|
||||
const path='public/index.html';
|
||||
let src=fs.readFileSync(path,'utf8');
|
||||
const replacements=[
|
||||
['<title>Солнце Кейтеринг</title>','<title>Caterium</title>'],
|
||||
['<meta name="apple-mobile-web-app-title" content="Солнце">','<meta name="apple-mobile-web-app-title" content="Caterium">'],
|
||||
['<div class="brand"><span class="sun">☼</span>Солнце Кейтеринг</div>','<div class="brand"><span class="sun">☼</span>Caterium</div>']
|
||||
];
|
||||
for(const [from,to] of replacements){
|
||||
const count=src.split(from).length-1;
|
||||
if(count!==1) throw new Error(`Expected exactly one occurrence: ${from}; found ${count}`);
|
||||
src=src.replace(from,to);
|
||||
}
|
||||
fs.writeFileSync(path,src);
|
||||
NODE
|
||||
- name: Commit branding repair
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add public/index.html
|
||||
git commit -m "brand: replace visible legacy name [branding-repair]"
|
||||
git push origin HEAD:fix/caterium-branding-v1774
|
||||
Loading…
Reference in New Issue
Block a user