Skip to content

Commit 86f0c39

Browse files
b1rdmaniaclaude
andcommitted
fix(/update): use git fetch + reset --hard instead of git pull
git pull fails when local and remote branches have diverged (e.g. after a manual build on the deployed machine). A deployed service should always match origin/main exactly, so reset --hard is correct here. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7855e82 commit 86f0c39

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/channels/telegram.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ export class TelegramChannel implements Channel {
8585
const cwd = process.cwd();
8686

8787
try {
88-
const pullOut = execSync('git pull', { cwd, encoding: 'utf-8' });
89-
await ctx.reply(`git pull: ${pullOut.trim()}`);
88+
execSync('git fetch origin', { cwd, encoding: 'utf-8' });
89+
const resetOut = execSync('git reset --hard origin/main', {
90+
cwd,
91+
encoding: 'utf-8',
92+
});
93+
await ctx.reply(`Updated: ${resetOut.trim()}`);
9094

9195
await ctx.reply('Building...');
9296
execSync('npm run build', { cwd, encoding: 'utf-8', timeout: 120_000 });

0 commit comments

Comments
 (0)