Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
fix: making changes to github repo does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Jul 23, 2024
1 parent 4c8728c commit 56a22e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions sources/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ export async function PushTokenToRepo(Repo: string, Token: string, SHA: string,
repo: Repo.split('/')[1],
path: SHA,
message: `Update for ${SHA}`,
content: Token,
committer: {
name: 'bot',
email: ''
},
author: {
name: 'bot',
email: ''
}
content: btoa(Token)
})
}
2 changes: 1 addition & 1 deletion sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FastifyInstance.post('/token', async (FRequest, FResponse) => {
FResponse.status(400).send('Invalid request')
return
}
const SHA = Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(FRequest.body)))).map(Block =>Block.toString(16).padStart(2, '0')).join('')
const SHA = Array.from(new Uint8Array(await crypto.subtle.digest('SHA-1', new TextEncoder().encode(FRequest.body)))).map(Block =>Block.toString(16).padStart(2, '0')).join('')
try {
await got.get(`https://cdn.jsdelivr.net/gh/List-KR/microShield-token@main/${SHA}`, {
http2: true,
Expand Down

0 comments on commit 56a22e1

Please sign in to comment.