fix: try-catch adding apt keys

This commit is contained in:
Amin Yahyaabadi 2022-04-18 02:31:21 -07:00
parent f3262ffc25
commit 548467eb8f
3 changed files with 10 additions and 5 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@
import { InstallationInfo } from "./setupBin" import { InstallationInfo } from "./setupBin"
import { execSudo } from "../exec/sudo" import { execSudo } from "../exec/sudo"
import { info } from "@actions/core" import { info } from "@actions/core"
import { warning } from "../io/io"
let didUpdate: boolean = false let didUpdate: boolean = false
let didInit: boolean = false let didInit: boolean = false
@ -37,9 +38,13 @@ export async function setupAptPack(
"ca-certificates", "ca-certificates",
"gnupg", "gnupg",
]) ])
try {
await execSudo("apt-key", ["adv", "--keyserver", "keyserver.ubuntu.com", "--recv-keys", "3B4FE6ACC0B21F32"]) await execSudo("apt-key", ["adv", "--keyserver", "keyserver.ubuntu.com", "--recv-keys", "3B4FE6ACC0B21F32"])
await execSudo("apt-key", ["adv", "--keyserver", "keyserver.ubuntu.com", "--recv-keys", "40976EAF437D05B5"]) await execSudo("apt-key", ["adv", "--keyserver", "keyserver.ubuntu.com", "--recv-keys", "40976EAF437D05B5"])
await execSudo("apt-key", ["adv", "--keyserver", "keyserver.ubuntu.com", "--recv-keys", "1E9377A2BA9EF27F"]) await execSudo("apt-key", ["adv", "--keyserver", "keyserver.ubuntu.com", "--recv-keys", "1E9377A2BA9EF27F"])
} catch (err) {
warning(`Failed to add keys: ${err}`)
}
didInit = true didInit = true
} }