diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46102ff40..8a95f24bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,6 @@ jobs: unit-test: runs-on: ubuntu-18.04 env: - ADMIN_EMAIL: firezone@localhost MIX_ENV: test POSTGRES_HOST: localhost GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/apps/fz_http/priv/repo/migrations/20211221183311_add_role_to_users.exs b/apps/fz_http/priv/repo/migrations/20211221183311_add_role_to_users.exs index 08bed0f6b..261a149d0 100644 --- a/apps/fz_http/priv/repo/migrations/20211221183311_add_role_to_users.exs +++ b/apps/fz_http/priv/repo/migrations/20211221183311_add_role_to_users.exs @@ -14,7 +14,10 @@ defmodule FzHttp.Repo.Migrations.AddRoleToUsers do # Make existing admin the admin if exists. Admin is most likely the first created user. flush() - admin_email = System.fetch_env!("ADMIN_EMAIL") - execute "UPDATE users SET role = 'admin' WHERE email = '#{admin_email}'" + admin_email = System.get_env("ADMIN_EMAIL") + + if admin_email do + execute "UPDATE users SET role = 'admin' WHERE email = '#{admin_email}'" + end end end