Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
fix: remove boot menu edit
Browse files Browse the repository at this point in the history
  • Loading branch information
xynydev committed Mar 27, 2024
1 parent ee9d7d3 commit bb02cac
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/components/ImageChooser/CreateRepo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -249,46 +249,6 @@
log += "Recipe updated successfully! \n";
}
const bootMenuRes = await fetch(
`https://api.github.com/repos/${custom.repo}/contents/boot_menu.yml`,
{
method: "get",
headers: { Authorization: `Bearer ${custom.auth}` },
}
);
const bootMenuJson = await bootMenuRes.json();
if (!bootMenuRes.ok) {
log += "Error getting boot menu: \n";
log += JSON.stringify(bootMenuJson);
log += "\n";
} else {
log += "Boot menu got successfully! \n";
}
const bootMenu = String(atob(bootMenuJson.content));
const bootMenuYml = YAML.parseDocument(bootMenu);
bootMenuYml.contents.deleteIn(['ublue_variants', 0])
bootMenuYml.contents.addIn(['ublue_variants'], { label: custom.repo?.toLowerCase(), ks: '/kickstart/ublue-os.ks', flavors: [{ label: custom.name }] })
const bootMenuUpdateRes = await fetch(
`https://api.github.com/repos/${custom.repo}/contents/boot_menu.yml`,
{
method: "put",
headers: { Authorization: `Bearer ${custom.auth}` },
body: JSON.stringify({
message:
"chore(automatic): update boot_menu to match image",
content: btoa(YAML.stringify(bootMenuYml)),
sha: bootMenuJson.sha,
}),
}
);
if (!bootMenuUpdateRes.ok) {
log += "Error updating boot menu. \n";
} else {
log += "Boot menu updated successfully! \n";
}
const workflowRes = await fetch(
`https://api.github.com/repos/${custom.repo}/actions/permissions`,
{
Expand Down

0 comments on commit bb02cac

Please sign in to comment.