Skip to content

Commit 359696f

Browse files
committed
ci: remove README auto-update steps to prevent merge conflicts on push
1 parent f71ce42 commit 359696f

2 files changed

Lines changed: 1 addition & 93 deletions

File tree

.github/workflows/nextjs-static-gh-pages.yml

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,6 @@ jobs:
2626
with:
2727
token: ${{ secrets.GITHUB_TOKEN }}
2828

29-
- name: 🧹 Strip stale deployment markers from README
30-
if: github.event_name == 'push'
31-
run: |
32-
if [ -f README.md ] && grep -q '<!-- DEPLOYMENT-URL:START -->' README.md; then
33-
echo "Stripping stale deployment markers from README..."
34-
# Remove everything between markers (inclusive), handling duplicates
35-
sed -i '/<!-- DEPLOYMENT-URL:START -->/,/<!-- DEPLOYMENT-URL:END -->/d' README.md
36-
# Also clean up any git conflict markers that might be left over
37-
sed -i '/^<<<<<<</d; /^=======/d; /^>>>>>>>/d' README.md
38-
# Remove resulting double-blank-lines
39-
sed -i '/^$/N;/^\n$/d' README.md
40-
if ! git diff --quiet README.md; then
41-
git config user.name "github-actions"
42-
git config user.email "github-actions@github.com"
43-
git add README.md
44-
git commit -m "ci: clean stale deployment markers from README [skip ci]"
45-
git push
46-
echo "Cleaned up stale deployment markers."
47-
fi
48-
fi
49-
5029
- name: 🔧 Set deployment variables
5130
id: vars
5231
run: |
@@ -210,73 +189,7 @@ jobs:
210189
});
211190
}
212191
213-
- name: 📝 Update README with deployment URL
214-
uses: actions/github-script@v7
215-
with:
216-
script: |
217-
const owner = context.repo.owner;
218-
const repo = context.repo.repo;
219-
const branch = '${{ steps.vars.outputs.branch }}';
220-
const previewUrl = '${{ steps.vars.outputs.preview_url }}';
221-
const sha = context.sha.substring(0, 7);
222-
const date = new Date().toISOString().split('T')[0];
223-
224-
// Fetch current README from the source branch
225-
let readmeData;
226-
try {
227-
readmeData = await github.rest.repos.getContent({
228-
owner, repo, path: 'README.md', ref: branch,
229-
});
230-
} catch (e) {
231-
console.log('No README.md found, skipping update.');
232-
return;
233-
}
234-
235-
const content = Buffer.from(readmeData.data.content, 'base64').toString('utf8');
236-
237-
const marker = {
238-
start: '<!-- DEPLOYMENT-URL:START -->',
239-
end: '<!-- DEPLOYMENT-URL:END -->',
240-
};
241-
242-
const section = [
243-
marker.start,
244-
`🌐 **Live Preview:** [${previewUrl}](${previewUrl})`,
245-
`<sub>Deployed from \`${sha}\` on ${date}</sub>`,
246-
marker.end,
247-
].join('\n');
248-
249-
let updated;
250-
if (content.includes(marker.start)) {
251-
// Replace existing section
252-
const re = new RegExp(
253-
`${marker.start}[\\s\\S]*?${marker.end}`,
254-
);
255-
updated = content.replace(re, section);
256-
} else {
257-
// Insert after the first heading line
258-
const lines = content.split('\n');
259-
const headingIdx = lines.findIndex(l => l.startsWith('# '));
260-
if (headingIdx !== -1) {
261-
lines.splice(headingIdx + 1, 0, '', section, '');
262-
updated = lines.join('\n');
263-
} else {
264-
updated = section + '\n\n' + content;
265-
}
266-
}
267-
268-
if (updated !== content) {
269-
await github.rest.repos.createOrUpdateFileContents({
270-
owner, repo, path: 'README.md',
271-
message: `docs: update deployment URL for ${branch} [skip ci]`,
272-
content: Buffer.from(updated).toString('base64'),
273-
sha: readmeData.data.sha,
274-
branch,
275-
});
276-
console.log(`README updated with preview URL: ${previewUrl}`);
277-
}
278-
279-
- name: 📌 Update PR description with preview URL
192+
- name: Update PR description with preview URL
280193
uses: actions/github-script@v7
281194
with:
282195
script: |

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
[![Deploy Next.js Docker App](https://github.com/codebuilderinc/codebuilder-frontend/actions/workflows/deploy.yml/badge.svg)](https://github.com/codebuilderinc/codebuilder-frontend/actions/workflows/deploy.yml) [![Deploy Static Next.js to GitHub Pages](https://github.com/codebuilderinc/codebuilder-frontend/actions/workflows/nextjs-static-gh-pages.yml/badge.svg)](https://github.com/codebuilderinc/codebuilder-frontend/actions/workflows/nextjs-static-gh-pages.yml)
44

5-
<!-- DEPLOYMENT-URL:START -->
6-
🌐 **Live Preview:** [https://dev.codebuilder.org/preview/feature-new-pages-and-ui-improvements/](https://dev.codebuilder.org/preview/feature-new-pages-and-ui-improvements/)
7-
<sub>Deployed from `6243f24` on 2026-04-02</sub>
8-
<!-- DEPLOYMENT-URL:END -->
9-
105
Next.js frontend for Codebuilder.
116

127
## Environment Files

0 commit comments

Comments
 (0)