From fdb60b9c10ed1274af29c0ce3f1c047e1afaf831 Mon Sep 17 00:00:00 2001 From: Rodion Mostovoi Date: Fri, 17 Nov 2023 18:34:46 +0800 Subject: [PATCH] Add environment variables for Azure OpenAI Replaced secrets with environment variables for AZURE_OPENAI_ENDPOINT_URL and AZURE_OPENAI_DEPLOYMENT_NAME in both publish_to_nuget and dotnet workflows. The reason for this change is to increase modularity and flexibility by using environment variables instead of secrets, making the solution more resilient and less reliant on specific single-use secrets. --- .github/workflows/dotnet.yml | 4 ++-- .github/workflows/publish_to_nuget.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 715d717..9c61605 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -29,6 +29,6 @@ jobs: env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} - AZURE_OPENAI_ENDPOINT_URL: ${{ secrets.AZURE_OPENAI_ENDPOINT_URL }} - AZURE_OPENAI_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_DEPLOYMENT_NAME }} + AZURE_OPENAI_ENDPOINT_URL: ${{ env.AZURE_OPENAI_ENDPOINT_URL }} + AZURE_OPENAI_DEPLOYMENT_NAME: ${{ env.AZURE_OPENAI_DEPLOYMENT_NAME }} run: dotnet test --no-build --verbosity normal diff --git a/.github/workflows/publish_to_nuget.yml b/.github/workflows/publish_to_nuget.yml index ac86405..56e295f 100644 --- a/.github/workflows/publish_to_nuget.yml +++ b/.github/workflows/publish_to_nuget.yml @@ -25,6 +25,9 @@ jobs: - name: Test env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} + AZURE_OPENAI_ENDPOINT_URL: ${{ env.AZURE_OPENAI_ENDPOINT_URL }} + AZURE_OPENAI_DEPLOYMENT_NAME: ${{ env.AZURE_OPENAI_DEPLOYMENT_NAME }} run: dotnet test --no-build --verbosity normal - name: Find NuGet packages