Search code examples
yamlgithub-actions

Running into Nektos/Act error permission denied when running actions locally


Pretty new to Nektos/act and in general running workflows locally and cant seem to find a solution to a permissions denied error when installing Node version 16. Here is the error I am running into when I run the following:

Command:

act -j release

Error:

docker exec cmd=[mkdir -p /var/run/act/actions/actions-setup-node@v1/] user= workdir=
mkdir: cannot create directory '/var/run/act/actions': Permission denied

Yaml (Example)

name: Release Example
on:
  push:
    branches: [ master ]
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          token: ${{secrets.PRIVATE_SECRET}}

      - name: Use version 16 of Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '16'

      - name: Pre Install
        run: echo "//npm.pkg.github.com/:_authToken=${{secrets.GITHUB_TOKEN}}"> ~/.npmrc

      - name: Install
        run: npm ci
        env:
          PRIVATE_SECRET: ${{secrets.PRIVATE_SECRET}}

      - name: Release
        env:
          GITHUB_TOKEN: ${{secrets.PRIVATE_SECRET}}
          PRIVATE_SECRET: ${{secrets.PRIVATE_SECRET}}
          REGISTRY_TOKEN: ${{secrets.PRIVATE_SECRET}}
        run: npx semantic-release

What I have tried:

  1. I have tried setting the user to root on the container for example

    container:
      image: ghcr.io/catthehacker/ubuntu:full-20.04
      options: --user root
    
  2. I have tried setting sudo in steps

     - run: sudo chown runner:docker /var/run/docker.sockenter
    
  3. I have tried passing the secrets via acts flags

  4. I have tried setting the working directory and setting env auth override to true

  5. I have checked issues related to this topic on the repo and it seems like others are facing the same issue but I have not been able to figure out a solution.

NOTE: This is all working on GitHub, but fails locally with the error mentioned above. Trying hard to test locally to not muddy up my repo with broken commits. Any help is greatly appreciated.


Solution

  • Appears to be a bug with the recent release. I confirm that downgrading to 0.2.24 fixed this issue.

    https://github.com/nektos/act/issues/935#issuecomment-1035261208

    brew remove act
    cd $(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula
    git checkout 3ab2604b1e630d4eccab40d0e78f29bd912a72b8 -- act.rb
    brew install act
    brew pin act
    git checkout HEAD -- act.rb
    act --version # make sure it's 0.2.24