mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: disable tools on opentest
This commit is contained in:
1 parent
48dcbbc227
commit
b9c978548a
20 files changed
+107
-99
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { ASSETS_REPO } from '../../constants/assets';
|
||||
import { assertSecrete } from './secrete';
|
||||
import { assertSecret } from './secret';
|
||||
|
||||
export function asset(path: string) {
|
||||
return `https://raw.githubusercontent.com/tresabhi/${ASSETS_REPO}/${assertSecrete(
|
||||
return `https://raw.githubusercontent.com/tresabhi/${ASSETS_REPO}/${assertSecret(
|
||||
process.env.NEXT_PUBLIC_ASSET_BRANCH,
|
||||
)}/${path}`;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ASSETS_REPO } from '../../constants/assets';
|
||||
import commitMultipleFiles, { FileChange } from './commitMultipleFiles';
|
||||
import { assertSecrete } from './secrete';
|
||||
import { assertSecret } from './secret';
|
||||
|
||||
export async function commitAssets(message: string, changes: FileChange[]) {
|
||||
console.log(`Committing ${message}...`);
|
||||
@@ -10,7 +10,7 @@ export async function commitAssets(message: string, changes: FileChange[]) {
|
||||
await commitMultipleFiles(
|
||||
'tresabhi',
|
||||
ASSETS_REPO,
|
||||
assertSecrete(process.env.NEXT_PUBLIC_ASSET_BRANCH),
|
||||
assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH),
|
||||
`${message} - ${new Date().toDateString()}`,
|
||||
changes,
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { throttling } from '@octokit/plugin-throttling';
|
||||
import { Octokit } from '@octokit/rest';
|
||||
import { assertSecrete } from './secrete';
|
||||
import { assertSecret } from './secret';
|
||||
|
||||
Octokit.plugin(throttling);
|
||||
|
||||
export const octokit = new Octokit({
|
||||
auth: assertSecrete(process.env.GH_TOKEN),
|
||||
auth: assertSecret(process.env.GH_TOKEN),
|
||||
});
|
||||
@@ -1,10 +1,10 @@
|
||||
import { assertSecrete } from './secrete';
|
||||
import { assertSecret } from './secret';
|
||||
|
||||
export function patreonLoginUrl() {
|
||||
const params = new URLSearchParams({
|
||||
response_type: 'code',
|
||||
client_id: assertSecrete(process.env.NEXT_PUBLIC_PATREON_CLIENT_ID),
|
||||
redirect_uri: assertSecrete(process.env.NEXT_PUBLIC_PATREON_REDIRECT_URI),
|
||||
client_id: assertSecret(process.env.NEXT_PUBLIC_PATREON_CLIENT_ID),
|
||||
redirect_uri: assertSecret(process.env.NEXT_PUBLIC_PATREON_REDIRECT_URI),
|
||||
scope: 'identity',
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export function assertSecret(secret?: string) {
|
||||
if (secret === undefined) throw new Error('Missing secret');
|
||||
return secret;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export function assertSecrete(secrete?: string) {
|
||||
if (secrete === undefined) throw new Error('Missing secret');
|
||||
return secrete;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ShardingManager } from 'discord.js';
|
||||
import { assertSecrete } from '../blitzkit/secrete';
|
||||
import { assertSecret } from '../blitzkit/secret';
|
||||
|
||||
export const manager = new ShardingManager('dist/bot/workers/bot.js', {
|
||||
token: assertSecrete(process.env.DISCORD_TOKEN),
|
||||
token: assertSecret(process.env.DISCORD_TOKEN),
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ASSETS_REPO } from '../../constants/assets';
|
||||
import { GithubChangeBlob, createBlob } from '../blitzkit/createBlob';
|
||||
import { octokit } from '../blitzkit/octokit';
|
||||
import { assertSecrete } from '../blitzkit/secrete';
|
||||
import { assertSecret } from '../blitzkit/secret';
|
||||
|
||||
export class AssetCommit {
|
||||
constructor(public message: string) {}
|
||||
@@ -26,7 +26,7 @@ export class AssetCommit {
|
||||
await octokit.git.getRef({
|
||||
owner: 'tresabhi',
|
||||
repo: ASSETS_REPO,
|
||||
ref: `heads/${assertSecrete(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
|
||||
ref: `heads/${assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
|
||||
})
|
||||
).data.object.sha;
|
||||
const treeSha = (
|
||||
@@ -54,7 +54,7 @@ export class AssetCommit {
|
||||
await octokit.git.updateRef({
|
||||
owner: 'tresabhi',
|
||||
repo: ASSETS_REPO,
|
||||
ref: `heads/${assertSecrete(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
|
||||
ref: `heads/${assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
|
||||
sha: newCommitData.sha,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user