Commit 7825f1b

Anton Golub <antongolub@antongolub.com>
2024-12-04 21:39:14
fix: add ossln badge to index (#92)
* fix: add ossnl badge to index * fix: fix ghUser fallback value * fix: reduce repos batch size
1 parent 01b695e
Changed files (4)
badges/index.ts
@@ -13,12 +13,13 @@ export default [
   await import('./fix-commit/fix-commit.js'),
   await import('./github-anniversary/github-anniversary.js'),
   await import('./mass-delete-commit/mass-delete-commit.js'),
-  await import('./reactions/reactions.js'),
   await import('./my-badges-contributor/my-badges-contributor.js'),
   await import('./old-issue/old-issue.js'),
+  await import('./oss-library-night-24/oss-library-night-24.js'),
   await import('./polite-coder/polite-coder.js'),
   await import('./pr-collaboration/pr-collaboration.js'),
   await import('./public-keys/public-keys.js'),
+  await import('./reactions/reactions.js'),
   await import('./revert-revert-commit/revert-revert-commit.js'),
   await import('./spooky-commit/spooky-commit.js'),
   await import('./star-gazer/star-gazer.js'),
src/task/repos/repos.graphql
@@ -35,7 +35,7 @@ fragment Repository on Repository {
 query ReposQuery(
   $login: String!
   $author: ID!
-  $num: Int = 100
+  $num: Int = 50
   $cursor: String
 ) {
   user(login: $login) {
src/task/repos/repos.graphql.ts
@@ -72,7 +72,7 @@ export type Repository = {
 
 export const ReposQuery = `#graphql
 ${Repository}
-query ReposQuery($login: String!, $author: ID!, $num: Int = 100, $cursor: String) {
+query ReposQuery($login: String!, $author: ID!, $num: Int = 50, $cursor: String) {
   user(login: $login) {
     repositories(
       first: $num
src/context.ts
@@ -50,8 +50,10 @@ export function createCtx(
     cwd: _cwd = CWD,
     token: ghToken = env.GITHUB_TOKEN,
     repo = env.GITHUB_REPO,
-    user: ghUser = argv._[0] || env.GITHUB_USER,
     data,
+    user: ghUser = argv._[0] ||
+      env.GITHUB_USER ||
+      (data && path.parse(data).name),
     size: badgesSize,
     dryrun,
     pick,
@@ -64,10 +66,7 @@ export function createCtx(
   const cwd = path.resolve(_cwd)
   const dataDir = path.resolve(cwd, DATA_DIR)
   const dataFile = path.resolve(dataDir, data || `${ghUser}.json`)
-  const dataTasks = path.resolve(
-    dataDir,
-    `${ghUser || path.parse(dataFile).name}.tasks.json`,
-  )
+  const dataTasks = path.resolve(dataDir, `${ghUser}.tasks.json`)
   const gitDir = path.resolve(cwd, GIT_DIR)
   const badgesDir = path.resolve(gitDir, BADGES_DIR)
   const badgesDatafile = path.resolve(badgesDir, data || BADGES_DATAFILE)