Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aa70f5a

Browse files
committed
Run prettifier + add replit changes + fix minor test_config.js issue
1 parent 07e7b1b commit aa70f5a

File tree

5 files changed

+214
-113
lines changed

5 files changed

+214
-113
lines changed

‎.replit‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
run = "node index.js test"
1+
run = "node index.js test"
2+
entrypoint = "index.js"
3+
hidden = [".config", "package-lock.json"]
4+
modules = ["nodejs-20:v8-20230920-bd784b9"]
5+
6+
[unitTest]
7+
language = "nodejs"
8+
9+
[nix]
10+
channel = "stable-23_05"
11+
12+
[gitHubImport]
13+
requiredFiles = [".replit", "replit.nix", "package.json", "package-lock.json"]
14+
15+
[deployment]
16+
run = ["node", "index.js"]
17+
deploymentTarget = "cloudrun"
18+
ignorePorts = false

‎index.js‎

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,55 @@
1-
const action = require('./src/action');
2-
const config = require('./src/test_config');
3-
const core = require('@actions/core');
4-
const { context } = require('@actions/github');
1+
const action = require("./src/action");
2+
const config = require("./src/test_config");
3+
const core = require("@actions/core");
4+
const { context } = require("@actions/github");
55

6-
const TEST_MODE = process.argv.includes('test');
6+
const TEST_MODE = process.argv.includes("test");
77

88
async function main() {
99
let githubToken, owner, repo, leetcodeCSRFToken, leetcodeSession;
1010
let filterDuplicateSecs, destinationFolder;
1111
if (TEST_MODE) {
12-
if (!config.GITHUB_TOKEN || !config.GITHUB_REPO || !config.LEETCODE_CSRF_TOKEN || !config.LEETCODE_SESSION) {
13-
throw new Error('Missing required configuration in src/test_config.js needed to run the test');
12+
if (
13+
!config.GITHUB_TOKEN ||
14+
!config.GITHUB_REPO ||
15+
!config.LEETCODE_CSRF_TOKEN ||
16+
!config.LEETCODE_SESSION
17+
) {
18+
throw new Error(
19+
"Missing required configuration in src/test_config.js needed to run the test",
20+
);
1421
}
1522
githubToken = config.GITHUB_TOKEN;
16-
[owner, repo] = config.GITHUB_REPO.split('/');
23+
[owner, repo] = config.GITHUB_REPO.split("/");
1724
leetcodeCSRFToken = config.LEETCODE_CSRF_TOKEN;
1825
leetcodeSession = config.LEETCODE_SESSION;
1926
filterDuplicateSecs = config.FILTER_DUPLICATE_SECS;
2027
destinationFolder = config.DESTINATION_FOLDER;
21-
verbose = config.VERBOSE.toString(); // Convert to string to match core.getInput('verbose') return type
28+
verbose = config.VERBOSE.toString(); // Convert to string to match core.getInput('verbose') return type
2229
commitHeader = config.COMMIT_HEADER;
2330
} else {
24-
githubToken = core.getInput('github-token');
31+
githubToken = core.getInput("github-token");
2532
owner = context.repo.owner;
2633
repo = context.repo.repo;
27-
leetcodeCSRFToken = core.getInput('leetcode-csrf-token');
28-
leetcodeSession = core.getInput('leetcode-session');
29-
filterDuplicateSecs = core.getInput('filter-duplicate-secs');
30-
destinationFolder = core.getInput('destination-folder');
31-
verbose = core.getInput('verbose');
32-
commitHeader = core.getInput('commit-header');
34+
leetcodeCSRFToken = core.getInput("leetcode-csrf-token");
35+
leetcodeSession = core.getInput("leetcode-session");
36+
filterDuplicateSecs = core.getInput("filter-duplicate-secs");
37+
destinationFolder = core.getInput("destination-folder");
38+
verbose = core.getInput("verbose");
39+
commitHeader = core.getInput("commit-header");
3340
}
3441

35-
await action.sync({ githubToken, owner, repo, leetcodeCSRFToken, leetcodeSession, filterDuplicateSecs, destinationFolder, verbose, commitHeader });
42+
await action.sync({
43+
githubToken,
44+
owner,
45+
repo,
46+
leetcodeCSRFToken,
47+
leetcodeSession,
48+
filterDuplicateSecs,
49+
destinationFolder,
50+
verbose,
51+
commitHeader,
52+
});
3653
}
3754

3855
main().catch((error) => {

‎replit.nix‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{pkgs}: {
2+
deps = [ ];
3+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /