sekura 0.5.2 → 0.5.3
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/session.js +1 -1
- package/dist/steps.js +18 -6
- package/package.json +1 -1
package/dist/session.js
CHANGED
|
@@ -114,7 +114,7 @@ export async function signInFresh(flags = {}) {
|
|
|
114
114
|
}
|
|
115
115
|
const where = saveKey(signed.key, account?.email ?? signed.account?.email, 'cli');
|
|
116
116
|
say(`${tick} Signed in to Sekura as ${who(account ?? signed.account, signed.key)}${signed.account?.created ? ' (new Sekura account)' : ''}; the key (${redact(signed.key)}) is kept in ${where}`);
|
|
117
|
-
return { key: signed.key, account, kind: 'cli', fresh: true };
|
|
117
|
+
return { key: signed.key, account, kind: 'cli', fresh: true, githubLogin: signed.account?.login ?? null };
|
|
118
118
|
}
|
|
119
119
|
catch (e) {
|
|
120
120
|
stop();
|
package/dist/steps.js
CHANGED
|
@@ -235,12 +235,22 @@ export async function ensureApp(s, flags = {}) {
|
|
|
235
235
|
let repos = repositoriesOf(list);
|
|
236
236
|
const covered = () => (want ? repos.some((r) => same(r.fullName, want)) : repos.length > 0);
|
|
237
237
|
const url = installLink(s, list);
|
|
238
|
-
|
|
238
|
+
// The App on the person's own GitHub account (29 November 2026). Repositories
|
|
239
|
+
// reached only through someone else's installation, on an account where the
|
|
240
|
+
// person collaborates, counted as "installed", so findsekura was never asked
|
|
241
|
+
// to install the App on findsekura and was shown Tikka's repository instead.
|
|
242
|
+
// Known only right after the GitHub-code sign-in; without it, as before.
|
|
243
|
+
const own = s.githubLogin ?? null;
|
|
244
|
+
const onOwn = () => !own || accountsOf(list).some((a) => same(a, own));
|
|
245
|
+
const ownMissing = !want && !flags.add && repos.length > 0 && !onOwn();
|
|
246
|
+
if (covered() && !flags.add && !ownMissing)
|
|
239
247
|
return { installed: true, found: true, repositories: repos, link: url, accounts: accountsOf(list) };
|
|
240
248
|
const onGithub = /^https:\/\/github\.com\//.test(url);
|
|
241
|
-
say(
|
|
242
|
-
?
|
|
243
|
-
:
|
|
249
|
+
say(ownMissing
|
|
250
|
+
? `${dot} The Sekura GitHub App is not installed on ${own} yet. It can reach ${repos.length === 1 ? 'one repository' : `${repos.length} repositories`} through ${accountsOf(list).join(', ')}, where you collaborate.`
|
|
251
|
+
: repos.length
|
|
252
|
+
? want && !covered() ? `${dot} ${want} is not one Sekura can scan yet: the Sekura GitHub App needs access to it.` : `${dot} To give Sekura more repositories, change the Sekura GitHub App's access.`
|
|
253
|
+
: `${dot} The Sekura GitHub App is not installed on any of your GitHub accounts yet, so there is nothing to scan.`);
|
|
244
254
|
if (!interactive) {
|
|
245
255
|
say(` Install it and choose repositories at ${url}`);
|
|
246
256
|
if (flags.soft || covered())
|
|
@@ -249,7 +259,7 @@ export async function ensureApp(s, flags = {}) {
|
|
|
249
259
|
}
|
|
250
260
|
if (!flags.add) {
|
|
251
261
|
const go = await select({
|
|
252
|
-
message: repos.length ? `Give Sekura access to ${want}?` : 'Install the Sekura GitHub App?',
|
|
262
|
+
message: ownMissing ? `Install the Sekura GitHub App on ${own}?` : repos.length ? `Give Sekura access to ${want}?` : 'Install the Sekura GitHub App?',
|
|
253
263
|
choices: [
|
|
254
264
|
{ name: `Yes, open ${onGithub ? 'github.com' : HOST} (GitHub asks which repositories)`, value: true },
|
|
255
265
|
{ name: repos.length ? 'No, pick from the repositories Sekura can already scan' : 'Not now', value: false },
|
|
@@ -266,11 +276,13 @@ export async function ensureApp(s, flags = {}) {
|
|
|
266
276
|
repos = repositoriesOf(list);
|
|
267
277
|
if (want)
|
|
268
278
|
return repos.some((x) => same(x.fullName, want));
|
|
279
|
+
if (ownMissing)
|
|
280
|
+
return accountsOf(list).some((a) => same(a, own));
|
|
269
281
|
return flags.add && before.size ? repos.some((x) => !before.has(x.fullName.toLowerCase())) : repos.length > 0;
|
|
270
282
|
}, flags.wait);
|
|
271
283
|
const found = r === 'done';
|
|
272
284
|
say(found
|
|
273
|
-
? `${tick} ${want ? `Sekura can scan ${want}` : before.size ? 'Sekura can scan more repositories now' : 'The Sekura GitHub App is installed'}`
|
|
285
|
+
? `${tick} ${want ? `Sekura can scan ${want}` : ownMissing ? `The Sekura GitHub App is installed on ${own}` : before.size ? 'Sekura can scan more repositories now' : 'The Sekura GitHub App is installed'}`
|
|
274
286
|
: `${dot} Not there yet; you can finish the install later with npx sekura@latest repos --add`);
|
|
275
287
|
return { installed: repos.length > 0, found, repositories: repos, link: url, accounts: accountsOf(list) };
|
|
276
288
|
}
|
package/package.json
CHANGED