name:AddMissionSource description:Addanewmissionsourcetotherepository. title:"[Mission Name]" labels: ["source request"] body: -type:input attributes: label:MissionName description:| The name of the mission for identification purposes. Scope will automatically added with who create this issue to prevent conflicts. -type:input attributes: label:Version description:| The version of the mission source. This is used to track changes and updates to the mission. It should follow semantic versioning (e.g., 1.0.0). validations: required:true -type:input attributes: label:gitURL description:ThegitURLofthemissionsourcerepository. validations: required:true -type:input attributes: label:MissionArchiveURL description:| The URL to the mission archive file (e.g., .zip, .tar.gz) that contains compiled mission data. GitHub release URLs is recommended. If not provided, the workflow will attempt to fetch the latest release from the repository. -type:checkboxes attributes: label:Agreement description:| By submitting this issue, you agree to the following: - The mission source does not violate any copyrights or licenses. - The mission should not contain any offensive or inappropriate content. - The mission source should not contain any malware or harmful code. options: -label:"Agree to the terms" required:true
const user = process.argv[2]; const issueMdArr = process.argv[3].split("\n");
(asyncfunctionconvertIssueToJson() { // define datas by markdown lines let missionName = issueMdArr[2]; let missionVersion = issueMdArr[6]; let missionGitUrl = issueMdArr[10]; let missionArchiveUrl = issueMdArr[14];
// check mission info by github api let missionInfoUrl = newURL(missionGitUrl); missionInfoUrl.hostname = "api.github.com"; let pathName = `repos${missionInfoUrl.pathname}/contents`; if (missionInfoUrl.searchParams.get("path")) { pathName += `/${missionInfoUrl.searchParams.get("path")}`; } pathName += "/mission.json"; missionInfoUrl.pathname = pathName;
// response is json blob let info = awaitfetch(missionInfoUrl) .then((res) => res.json()) .then((data) =>JSON.parse(atob(data.content))) .catch((err) => { throw err; });