Skip to content

Fallback to different installation directory if /usr/share/dotnet doesn't available due to permissions #518

Open
@maxim-lobanov

Description

@maxim-lobanov

Description:

By default, dotnet is downloaded and installed under /usr/share/dotnet folder:

linux: '/usr/share/dotnet',

Unfortunately, it is not great location because on some self-hosted runners and some Larger Runners (Linux Arm64 private beta), user doesn't have enough permissions to create / modify this folder.

In this case, action will fail with error:
Error: Failed to install dotnet, exit code: 1. mkdir: cannot create directory '/usr/share/dotnet': Permission denied

Proposed solution
I guess it is not possible to change default location /usr/share/dotnet to some new location because it will be a breaking change. So I am proposing adding a new fallback location in case if user doesn't have permissions for /usr/share/dotnet. It won't be a breaking change because fallback will be used only in cases when the current version of action would fail.

This action can check permissions of /usr/share/dotnet folder. If user doesn't have permissions to create / modify this folder, then the action should use different DOTNET_INSTALL_DIR directory instead of /usr/share/dotnet.

For example, it can use:

Alternative solutions

There are two alternative solutions:

  • Change permissions of /usr/share/dotnet once on self-hosted agent -> Unfortunately, it won't fix Linux Arm64 Larger Runners. Also, it is not super convenient and involve manual actions
  • User can override DOTNET_INSTALL_DIR environment variable by themselves -> it is definitely possible option but it is not super convenient and user needs to do it for every workflow YAML

We definitely have workarounds but it would be great if action can handle this case without workarounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions