How to set environment variables as JSON in github actions

  Kiến thức lập trình

I use .net 8.
In variable secrets.AZURE_SECRETS I have secrets stored in JSON format.
How to provide it correctly to the pipeline?

name: PR Check

on:
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: 8.0.x
    - name: Setup docker
      run: |
        sudo apt-get update
        sudo apt-get install -y docker-compose
    - name: Restore dependencies
      run: dotnet restore Bidnest.sln
    - name: Provide secrets
      run: type ${{ secrets.AZURE_SECRETS }}  | dotnet user-secrets set
    - name: Build
      run: dotnet build Bidnest.sln --no-restore
    - name: Test
      run: dotnet test Bidnest.Test --no-build --verbosity normal

LEAVE A COMMENT