Skip to content

Commit

Permalink
feat: load environment variables from /run/drone/env file
Browse files Browse the repository at this point in the history
- Add check for `/run/drone/env` file and load environment variables if it exists

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Jul 14, 2024
1 parent 1381977 commit 052d6e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 052d6e7

Please # to comment.