47 lines
1.8 KiB
YAML
47 lines
1.8 KiB
YAML
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
|