skillsets 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/submit.js +2 -0
- package/package.json +1 -1
package/dist/commands/submit.js
CHANGED
|
@@ -200,6 +200,8 @@ export async function submit() {
|
|
|
200
200
|
const repoName = REGISTRY_REPO.split('/')[1];
|
|
201
201
|
const forkRemote = `https://github.com/${username}/${repoName}.git`;
|
|
202
202
|
spawnSync('git', ['remote', 'add', 'fork', forkRemote], { cwd: tempDir, stdio: 'ignore' });
|
|
203
|
+
// Delete stale branch on fork (e.g. from a previously merged PR)
|
|
204
|
+
spawnSync('gh', ['api', `repos/${username}/${repoName}/git/refs/heads/${branchName}`, '-X', 'DELETE'], { stdio: 'ignore' });
|
|
203
205
|
const pushResult = spawnSync('git', ['push', '-u', 'fork', branchName, '--force'], { cwd: tempDir, encoding: 'utf-8' });
|
|
204
206
|
if (pushResult.status !== 0) {
|
|
205
207
|
throw new Error(pushResult.stderr || 'Failed to push to fork');
|