From e53a030f107a0eeba54befa063aefe531caff86b Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Wed, 3 Jul 2024 13:27:50 +0530 Subject: [PATCH] Set the GH token as an action secret in the deployment repository (#492) --- fastagency/saas_app_generator.py | 3 +++ tests/test_saas_app_generator.py | 1 + 2 files changed, 4 insertions(+) diff --git a/fastagency/saas_app_generator.py b/fastagency/saas_app_generator.py index e344bd56..01368c3b 100644 --- a/fastagency/saas_app_generator.py +++ b/fastagency/saas_app_generator.py @@ -300,6 +300,9 @@ def _set_github_actions_secrets(self, cwd: str, env: Dict[str, Any]) -> None: command = 'gh secret set FASTAGENCY_DEPLOYMENT_UUID --body "$FASTAGENCY_DEPLOYMENT_UUID" --app actions' self._run_cli_command(command, cwd=cwd, env=secrets_env, print_output=True) + command = 'gh secret set USER_GH_PAT --body "$GH_TOKEN" --app actions' + self._run_cli_command(command, cwd=cwd, env=secrets_env, print_output=True) + command = f'gh variable set REACT_APP_NAME --body "{self.app_name}"' self._run_cli_command(command, cwd=cwd, env=secrets_env, print_output=True) diff --git a/tests/test_saas_app_generator.py b/tests/test_saas_app_generator.py index 5f6912fb..d6fc2a91 100644 --- a/tests/test_saas_app_generator.py +++ b/tests/test_saas_app_generator.py @@ -203,6 +203,7 @@ def test_set_github_actions_secrets( expected_commands = [ 'gh secret set FLY_API_TOKEN --body "$FLY_API_TOKEN" --app actions', 'gh secret set FASTAGENCY_DEPLOYMENT_UUID --body "$FASTAGENCY_DEPLOYMENT_UUID" --app actions', + 'gh secret set USER_GH_PAT --body "$GH_TOKEN" --app actions', f'gh variable set REACT_APP_NAME --body "{saas_app_generator.app_name}"', f'gh variable set FLY_IO_APP_NAME --body "{saas_app_generator.fly_app_name}"', ]