fix(git_server): make sure refName is url encoded to avoid trouble with / or quotes@@ -1,5 +1,5 @@
{
- "_generatedAtUnix": 1665170537064,
+ "_generatedAtUnix": 1665170686793,
"_hashAlgorithm": "sha1",
"_version": 2,
"islands": {
@@ -58,7 +58,7 @@
"pathSourceMap": "./public/.islands/RepositoryInitialSetup.bundle.js.map"
},
"RepositoryPullRequestCreateForm": {
- "hash": "74829146dd82b6f06c73911c9e1b02673b7a4a0f",
+ "hash": "2ac0d180c4a2671fe95215f22e02ad2149b93e16",
"pathSource": "./app/islands/RepositoryPullRequestCreateForm.tsx",
"pathBundle": "./public/.islands/RepositoryPullRequestCreateForm.bundle.js",
"pathSourceMap": "./public/.islands/RepositoryPullRequestCreateForm.bundle.js.map"
@@ -172,33 +172,39 @@ const RepositoryPullRequestCreateForm: ReactIsland<RepositoryPullRequestCreateFo
</select>
{/* VS. */}
- <div>
- <span>Target:</span>
- </div>
+ {data.initialTarget != null && (
+ <>
+ <div>
+ <span>Target:</span>
+ </div>
- <input
- disabled
- type={"text"}
- name={"target_parent_org_display_name"}
- value={
- data.source.parentOrg.displayName || data.source.parentOrg.slug
- }
- />
- {" / "}
- <input
- disabled
- type={"text"}
- name={"target_repository_display_name"}
- value={data.source.repo.displayName || data.source.repo.slug}
- />
- {" / "}
- <select name={"target_repository_from_branch"}>
- {data.source.branches.map((branch, idx) => (
- <option key={[branch, idx].join(":")} value={branch}>
- {branch}
- </option>
- ))}
- </select>
+ <input
+ disabled
+ type={"text"}
+ name={"target_parent_org_display_name"}
+ value={
+ data.initialTarget.parentOrg.displayName ||
+ data.initialTarget.parentOrg.slug
+ }
+ />
+ {" / "}
+ <input
+ disabled
+ type={"text"}
+ name={"target_repository_display_name"}
+ value={
+ data.initialTarget.repo.displayName ||
+ data.initialTarget.repo.slug
+ }
+ />
+ {" / "}
+ <select name={"target_repository_from_branch"}>
+ <option value={data.initialTarget.branch}>
+ {data.initialTarget.branch}
+ </option>
+ </select>
+ </>
+ )}
<button type={"submit"}>Go to COMPARE step</button>
</form>
@@ -62,11 +62,17 @@ const makeOnPushEvent: ServiceMethodFactory<
`🚀 Quickly create a pull-request from this branch at:\n`
);
message.write(
- `🔗 ${repoUrlBase}/pulls/new?from_branch=${data.payload.refName}\n`
+ `🔗 ${repoUrlBase}/pulls/new?from_branch=${encodeURIComponent(
+ data.payload.refName
+ )}\n`
);
}
} else if (data.payload.refType === "tag") {
- message.write(`🏷 ${repoUrlBase}/tags/${data.payload.refName}\n`);
+ message.write(
+ `🏷 ${repoUrlBase}/tags/${encodeURIComponent(
+ data.payload.refName
+ )}\n`
+ );
}
}