From c5125c3400a4f33d888595618eb9588a0101415e Mon Sep 17 00:00:00 2001 From: danparisd <43418833+danparisd@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:58:08 -0500 Subject: [PATCH] switch to 1password secret (#140) --- .github/workflows/dotnet.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6b6be4e..fad6b44 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -23,6 +23,15 @@ jobs: run: dotnet build --no-restore -c Release - name: Test run: dotnet test -c Release + - name: Load secret + if: contains( github.ref, 'refs/tags/v' ) + uses: 1password/load-secrets-action@v1 + with: + # Export loaded secrets as environment variables + export-env: true + env: + OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + NUGET_TOKEN: "op://DevOps/nuget-push-token/credential" - name: Push to Nuget if tagged if: contains( github.ref, 'refs/tags/v' ) run: | @@ -30,4 +39,4 @@ jobs: PKG_NAME=$(ls *.nupkg) && \ dotnet nuget push $PKG_NAME -k $NUGET_TOKEN -s https://api.nuget.org/v3/index.json env: - NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} + NUGET_TOKEN: ${{ env.NUGET_TOKEN }}