mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
fix: the github-range runner throws so an orphaned BEFORE_SHA can fall back to dev
resolveValidationRange already knows how to replace a force-push-orphaned BEFORE_SHA with origin/dev, but the CLI handed it a runner that killed the process with exit 2 on the first cat-file instead of throwing into gitObjectExists' catch. Every push after a mandatory issue-branch rebase therefore painted process-gate red (runs 32939996348, 32940625718, 32942113142). The regression test drives the real CLI in a throwaway repo with a BEFORE_SHA that no longer exists. Issue: #315 User-Visible: no
This commit is contained in:
@@ -575,13 +575,20 @@ function main(argv) {
|
||||
|
||||
let range = value('range');
|
||||
if (!range && flag('github-range')) {
|
||||
// gitObjectExists ловит исключение, чтобы подменить осиротевший после
|
||||
// force-push BEFORE_SHA на origin/dev (#315). Раннер обязан бросать,
|
||||
// а не завершать процесс, как это делает git() ниже.
|
||||
range = resolveValidationRange({
|
||||
eventName: process.env.EVENT_NAME,
|
||||
beforeSha: process.env.BEFORE_SHA,
|
||||
baseSha: process.env.BASE_SHA,
|
||||
headSha: process.env.HEAD_SHA,
|
||||
developmentBranch: process.env.DEVELOPMENT_BRANCH,
|
||||
}, (args) => git(args, repo).trim());
|
||||
}, (args) => {
|
||||
const r = spawnSync('git', ['-C', repo, ...args], { encoding: 'utf8' });
|
||||
if (r.status !== 0) throw new Error(`git ${args.join(' ')} → ${(r.stderr || '').trim()}`);
|
||||
return r.stdout.trim();
|
||||
});
|
||||
}
|
||||
if (!range) {
|
||||
const hasDev = spawnSync('git', ['-C', repo, 'rev-parse', '--verify', 'origin/dev'],
|
||||
|
||||
Reference in New Issue
Block a user