Fix folder creation
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
SebClem 2023-07-04 17:11:26 +02:00
parent ea58b30827
commit b373644748
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -151,7 +151,8 @@ func main() {
pluginConfig := getPluginConfig(sugar)
if pluginConfig.privateKey != nil {
runCommand(sugar, "mkdir", "/root/.ssh")
sugar.Info("🔑 Adding ssh key to .ssh/id_ed25519")
os.MkdirAll("/root/.ssh", 0700)
err := os.WriteFile("/root/.ssh/id_ed25519", []byte(*pluginConfig.privateKey), 0400)
if err != nil {
sugar.Fatal(err)
@ -162,6 +163,7 @@ func main() {
if pluginConfig.vaultToken != nil {
sugar.Info("💼 Adding vault token to 'credentials/ci_vault_token'")
os.MkdirAll("credentials", 0755)
runCommand(sugar, "mkdir", "credentials")
err := os.WriteFile("credentials/ci_vault_token", []byte(*pluginConfig.vaultToken), 0644)
if err != nil {