Compare commits

...

1 Commits

Author SHA1 Message Date
Andrew Eisenberg
b74202b022 Make the default github.com path consistent with other paths
On util.ts:223, there is the following comment:

```
// Normalise path to having a trailing slash for consistency
```

However, I notice that the path defined by `GITHUB_DOTCOM_URL`
does not have a trailing slash. This PR fixes it.
2021-02-23 22:17:36 -08:00
6 changed files with 13 additions and 13 deletions

2
lib/util.js generated
View File

@@ -17,7 +17,7 @@ const apiCompatibility = __importStar(require("./api-compatibility.json"));
/**
* The URL for github.com.
*/
exports.GITHUB_DOTCOM_URL = "https://github.com";
exports.GITHUB_DOTCOM_URL = "https://github.com/";
/**
* Get the extra options for the codeql commands.
*/

File diff suppressed because one or more lines are too long

8
lib/util.test.js generated
View File

@@ -103,10 +103,10 @@ ava_1.default("getExtraOptionsEnvParam() fails on invalid JSON", (t) => {
process.env.CODEQL_ACTION_EXTRA_OPTIONS = origExtraOptions;
});
ava_1.default("parseGithubUrl", (t) => {
t.deepEqual(util.parseGithubUrl("github.com"), "https://github.com");
t.deepEqual(util.parseGithubUrl("https://github.com"), "https://github.com");
t.deepEqual(util.parseGithubUrl("https://api.github.com"), "https://github.com");
t.deepEqual(util.parseGithubUrl("https://github.com/foo/bar"), "https://github.com");
t.deepEqual(util.parseGithubUrl("github.com"), "https://github.com/");
t.deepEqual(util.parseGithubUrl("https://github.com"), "https://github.com/");
t.deepEqual(util.parseGithubUrl("https://api.github.com/"), "https://github.com/");
t.deepEqual(util.parseGithubUrl("https://github.com/foo/bar"), "https://github.com/");
t.deepEqual(util.parseGithubUrl("github.example.com"), "https://github.example.com/");
t.deepEqual(util.parseGithubUrl("https://github.example.com"), "https://github.example.com/");
t.deepEqual(util.parseGithubUrl("https://api.github.example.com"), "https://github.example.com/");

File diff suppressed because one or more lines are too long

View File

@@ -126,15 +126,15 @@ test("getExtraOptionsEnvParam() fails on invalid JSON", (t) => {
});
test("parseGithubUrl", (t) => {
t.deepEqual(util.parseGithubUrl("github.com"), "https://github.com");
t.deepEqual(util.parseGithubUrl("https://github.com"), "https://github.com");
t.deepEqual(util.parseGithubUrl("github.com"), "https://github.com/");
t.deepEqual(util.parseGithubUrl("https://github.com"), "https://github.com/");
t.deepEqual(
util.parseGithubUrl("https://api.github.com"),
"https://github.com"
util.parseGithubUrl("https://api.github.com/"),
"https://github.com/"
);
t.deepEqual(
util.parseGithubUrl("https://github.com/foo/bar"),
"https://github.com"
"https://github.com/"
);
t.deepEqual(

View File

@@ -19,7 +19,7 @@ export type Mode = "actions" | "runner";
/**
* The URL for github.com.
*/
export const GITHUB_DOTCOM_URL = "https://github.com";
export const GITHUB_DOTCOM_URL = "https://github.com/";
/**
* Get the extra options for the codeql commands.