Skip to content

Commit 2a9b7f9

Browse files
committed
refactor(actions): reference environment workspace
1 parent ff2a4aa commit 2a9b7f9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/backend.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
test:
2525
name: Test Code
2626
runs-on: ubuntu-latest
27+
environment: backend
2728
steps:
2829
- uses: actions/checkout@v4
2930
- uses: actions/setup-go@v5
@@ -34,6 +35,7 @@ jobs:
3435
touch .env
3536
echo ATLAS_URI=${{ secrets.ATLAS_URI }} >> .env
3637
echo ENVIRONMENT=Dev >> .env
37-
cat .env
38+
with:
39+
working-directory: backend
3840
- name: Test Code
3941
run: cd backend && go test ./...

backend/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ func main() {
1717

1818
err := godotenv.Load()
1919
if err != nil {
20-
log.Fatal("Could not load .env")
21-
log.Fatal(err)
20+
log.Fatal("Unable to load .env file.")
2221
}
2322

2423
_, _, collections, err := database.Connect(context.Background(), os.Getenv("ATLAS_URI"))
2524

2625
if err != nil {
27-
log.Fatalf("Failed to connect to MongoDB")
26+
log.Fatalf("Failed to connect to MongoDB.")
2827
}
2928

3029
app := server.New(collections)

0 commit comments

Comments
 (0)