feat: load environment variables from `/run/drone/env` file

- Add check for `/run/drone/env` file and load environment variables if it exists

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-07-14 22:10:19 +08:00
parent 13819778ab
commit 052d6e71bc
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,10 @@ func main() {
_ = godotenv.Load(filename)
}
if _, err := os.Stat("/run/drone/env"); err == nil {
_ = godotenv.Overload("/run/drone/env")
}
app := cli.NewApp()
app.Name = "Drone SCP"
app.Usage = "Copy files and artifacts via SSH."