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.
This commit is contained in:
Andrew Eisenberg
2021-02-23 15:31:02 -08:00
parent 7f1d7b8bda
commit b74202b022
6 changed files with 13 additions and 13 deletions
Generated
+1 -1
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.
*/
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -4
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/");
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -5
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(
+1 -1
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.