Skip to content

global-json-file input does not accept absolute paths #378

@othmane-kinane-nw

Description

@othmane-kinane-nw

Description:
setup-dotnet does not handle correctly absolute paths as value for the global-json-file input. The action always join the provided value with the github workspace (aka respository's root) instead of using it as-is if it's an absolute path.

Task version:
v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Pass an absolute path as value for the global-json-file input that points to a global.json file in a subfolder.
Do not use the dotnet-version input.
ex:

    - name: Setup .NET
      uses: actions/setup-dotnet@v3
      with:
        global-json-file: ${{ github.workspace }}/backend/global.json

Expected behavior:
The action finishes with success and the provided global.json is used.

Actual behavior:
The action fails with this error:

Error: The specified global.json file '/home/runner/work/reponame/reponame/backend/global.json' does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions