Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Szedann committed Sep 6, 2023
2 parents 7aac033 + 33ab129 commit cd01620
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# These are needed no matter what
DISCORD_TOKEN=
OWNER_ID=
SAY_LOGS_CHANNEL=
LOGS_CHANNEL=

# These arent needed outside of production
MAVEN_REPO=
GITHUB_STATUS_CHANNEL=
GITHUB_SECRET=
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Docker

on:
push:
branches: [main]

env:
REGISTRY: ghcr.io
Expand Down
12 changes: 5 additions & 7 deletions src/commands/_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import { warnCommand } from './moderation/warn.command';
import { sayCommand } from './util/say.command';
import { tagCommand } from './util/tag.command';

export const commands: Command[] = [
sayCommand,
tagCommand,
warnCommand,
listWarningsCommand,
deleteWarningCommand,
];
export const commands: Command[] = [sayCommand, tagCommand];

if (process.env.NODE_ENV !== 'development') {
commands.push(warnCommand, deleteWarningCommand, listWarningsCommand);
}

export default commands;
14 changes: 13 additions & 1 deletion src/logIssueAnalyzers/createVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@ export const createVersionAnalyzer: Analyzer = async (log) => {
const matchesCreate = log.mods
? log.mods.get('create') == '0.5.1.b'
: log.content.match(/create-(.)+-0\.5\.1\.b/);
const matchesSNR = log.mods.get('railways')?.includes('1.5.0');
const matchesSNR = log.mods.get('railways')?.match(/1\.5\.0/);
// Return an issue if both mods are present and the versions match.
if (matchesCreate && matchesSNR) {
return {
name: 'Incompatible with Create 0.5.1b',
value: "Create: Steam 'n' Rails `1.5.0` is incompatible with `Create 0.5.1b`. Upgrade to `Create 0.5.1c` or downgrade Steam 'n' Rails.",
};
}

const matchesCreate2 = log.mods
? log.mods.get('create') == '0.5.1.c'
: log.content.match(/create-(.)+-0\.5\.1\.c/);
const matchesSNR2 = log.mods.get('railways')?.match(/1\.4\.3/);
// Return an issue if both mods are present and the versions match.
if (matchesCreate2 && matchesSNR2) {
return {
name: 'Version error',
value: "Create: Steam 'n' Rails `1.4.3` is incompatible with `Create 0.5.1c`. Upgrade Steam 'n' Rails to `1.5.0`.",
};
}
return null;
};
3 changes: 1 addition & 2 deletions src/types/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ declare global {
namespace NodeJS {
interface ProcessEnv {
DISCORD_TOKEN: string;
OWNER_ID: string;
SAY_LOGS_CHANNEL: string;
LOGS_CHANNEL: string;
MAVEN_REPO: string;
Expand All @@ -15,7 +14,7 @@ declare global {
FAIL_EMOJI: string;
WEBSERVER_PORT: string;
DATABASE_URL: string;
NODE_ENV: 'development' | 'production';
NODE_ENV: 'development' | 'dev-prod' | 'production';
}
}
}
2 changes: 1 addition & 1 deletion src/webserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ app.post('/github-webhook', function (req, res) {
handleWebhook(client, req, res);
});

const port = process.env.WEBSERVER_PORT;
const port = process.env.WEBSERVER_PORT || 3000;
app.listen(port);
console.log(`Webserver is running on port: ${port}`);

0 comments on commit cd01620

Please sign in to comment.