skillsets 0.4.3 → 0.4.4
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 +8 -5
- package/package.json +1 -1
package/dist/commands/submit.js
CHANGED
|
@@ -194,12 +194,15 @@ export async function submit() {
|
|
|
194
194
|
? `Update ${skillsetId} to v${skillset.version}`
|
|
195
195
|
: `Add ${skillsetId}`;
|
|
196
196
|
spawnSync('git', ['commit', '-m', commitMsg], { cwd: tempDir, stdio: 'ignore' });
|
|
197
|
-
// Push
|
|
198
|
-
spinner.text = 'Pushing
|
|
197
|
+
// Push to user's fork (contributors don't have push access to upstream)
|
|
198
|
+
spinner.text = 'Pushing to fork...';
|
|
199
199
|
execSync('gh auth setup-git', { cwd: tempDir, stdio: 'ignore' });
|
|
200
|
-
const
|
|
200
|
+
const repoName = REGISTRY_REPO.split('/')[1];
|
|
201
|
+
const forkRemote = `https://github.com/${username}/${repoName}.git`;
|
|
202
|
+
spawnSync('git', ['remote', 'add', 'fork', forkRemote], { cwd: tempDir, stdio: 'ignore' });
|
|
203
|
+
const pushResult = spawnSync('git', ['push', '-u', 'fork', branchName, '--force'], { cwd: tempDir, encoding: 'utf-8' });
|
|
201
204
|
if (pushResult.status !== 0) {
|
|
202
|
-
throw new Error(pushResult.stderr || 'Failed to push
|
|
205
|
+
throw new Error(pushResult.stderr || 'Failed to push to fork');
|
|
203
206
|
}
|
|
204
207
|
// Create PR
|
|
205
208
|
spinner.text = 'Creating pull request...';
|
|
@@ -248,7 +251,7 @@ _Add any additional context for reviewers here._
|
|
|
248
251
|
---
|
|
249
252
|
Submitted via \`npx skillsets submit\`
|
|
250
253
|
`;
|
|
251
|
-
const prResult = spawnSync('gh', ['pr', 'create', '--repo', REGISTRY_REPO, '--title', prTitle, '--body', prBody], {
|
|
254
|
+
const prResult = spawnSync('gh', ['pr', 'create', '--repo', REGISTRY_REPO, '--head', `${username}:${branchName}`, '--title', prTitle, '--body', prBody], {
|
|
252
255
|
cwd: tempDir,
|
|
253
256
|
encoding: 'utf-8',
|
|
254
257
|
});
|