Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot create directory ‘/usr/share/dotnet’: Permission denied #12

Closed
HGGamers opened this issue Jun 7, 2023 · 2 comments
Closed

Comments

@HGGamers
Copy link

HGGamers commented Jun 7, 2023

I am currently trying to get a .net console application built.
Unfortunately it can't install .net because it doesn't have permissions to create the folder. Here is the error message:

[command]/run/act/actions/https---git.luolix.top-actions-setup-dotnet@v3/externals/install-dotnet.sh --channel 7.0
mkdir: cannot create directory ‘/usr/share/dotnet’: Permission denied
::error::Failed to install dotnet, exit code: 1. mkdir: cannot create directory ‘/usr/share/dotnet’: Permission denied%0A

Here is the workflow file:

name: .NET

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: https://github.com/actions/checkout@v3
    - name: Setup .NET
      uses: https://github.com/actions/setup-dotnet@v3
      with:
        dotnet-version: 7.0.x
    - name: Restore dependencies
      run: dotnet restore
    - name: Build
      run: dotnet build --no-restore
    - name: Upload a Build Artifact
      uses: https://github.com/actions/upload-artifact@v3.1.2
      with:
       name: Release 
       path: ./TestApplication/TestApplication/bin/Debug/net7.0/
       if-no-files-found: error
       retention-days: 90

Here is the Docker Compose part:

  gitea_act_runner:
    image: vegardit/gitea-act-runner:latest
    restart: unless-stopped
    container_name: gitearunner
    depends_on:
      - gitea
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:rw
      - ./gitea-builder:/data:rw
    environment:
      - TZ=Europe/Berlin
      - GITEA_INSTANCE_URL=XXXX
      - GITEA_RUNNER_REGISTRATION_TOKEN=XXXXX

Am I missing something obvious here that I still need to adjust?

@sebthom
Copy link
Member

sebthom commented Jun 7, 2023

I think you are hitting this issue actions/setup-dotnet#327
The solution seems to be actions/setup-dotnet#327 (comment)

@HGGamers
Copy link
Author

HGGamers commented Jun 7, 2023

Perfect that worked. Thanks for the help.

@HGGamers HGGamers closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants