1

I'm new to yaml & Github & actions and trying to figure out how to assign x=y vs. x=value. Is this possible? In the example below, I'm trying to assign CertificatePath as a global variable to a concatenation of several directories.

    env:
      Solution_Name: WpfApp3.sln 
      Test_Project_Path: TestProject1\TestProject1.csproj
      Wap_Project_Directory: WapProjTemplate1
      Wap_Project_Path: WapProjTemplate1\WapProjTemplate1.wapproj
      SigningCertificate: GitHubActionsDemo.pfx
    - name: SetCertPath
      run: 
        $currentDirectory = Get-Location
        tempcertificatePath= Join-Path -Path $currentDirectory -ChildPath $env:Wap_Project_Directory -AdditionalChildPath $env:SigningCertificate
        echo "CertificatePath=${{ tempcertificatePath }}" >> $GITHUB_ENV

Thanks!

1 Answer 1

3

If you want to run multiple lines as part of a run step, you need to use a |. Furthermore, when assigning a variable, you don't need to use the $ on the left hand side.

Example:

- run: |
    myVar="foo"
    mySecondVar="${myVar}bar"
    echo $mySecondVar
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.