-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marin Petrunic <[email protected]>
- Loading branch information
Showing
13 changed files
with
6,988 additions
and
5,328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
**/node_modules | ||
.env | ||
**/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Stage 1: Build the TypeScript code | ||
FROM node:20-alpine AS build | ||
|
||
WORKDIR /app | ||
|
||
RUN corepack enable | ||
|
||
COPY package.json yarn.lock .yarn .yarnrc.yml ./ | ||
COPY packages/zu-git-proofs-server/package.json packages/zu-git-proofs-server/ | ||
|
||
RUN yarn workspaces focus zu-git-proofs-server | ||
|
||
COPY . . | ||
|
||
CMD ["yarn", "workspace", "zu-git-proofs-server", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '3.8' | ||
|
||
services: | ||
server: | ||
image: ghcr.io/mpetrunic/zu-git-proofs-server:v0.1 | ||
container_name: zu-git-proof-server | ||
env_file: zu-git-pass.env | ||
ports: | ||
- "9000:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
{ | ||
"name": "zu-git-proofs", | ||
"packageManager": "yarn@3.3.1", | ||
"packageManager": "yarn@4.2.2", | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
] | ||
], | ||
"devDependencies": { | ||
"tsx": "4.11.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import jsonData from './artifacts/badge-members.json' | ||
// @ts-expect-error | ||
import jsonData from './artifacts/badge-members.json' assert {type: 'json'}; | ||
|
||
|
||
export async function getGithubBadhes(githubUsername: string): Promise<string|undefined> { | ||
const badges: string[] = [] | ||
export async function getGithubBadhes(githubEmails: string[]): Promise<string|undefined> { | ||
const badges = new Set() | ||
Object.entries(jsonData).forEach(([badge, badgeMembers]) => { | ||
if((badgeMembers as string[]).includes(githubUsername.toLowerCase())) { | ||
badges.push(badge) | ||
} | ||
githubEmails.forEach((email) => { | ||
if((badgeMembers as string[]).includes(email.toLowerCase())) { | ||
badges.add(badge) | ||
} | ||
}) | ||
}) | ||
if(badges.length == 0) { | ||
if(badges.size == 0) { | ||
return undefined | ||
} | ||
return badges.join(",") | ||
return Array.from(badges.values()).join(",") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.