subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.28k stars 202 forks source link

setup.sh: Permission denied #245

Closed baconcheese113 closed 1 year ago

baconcheese113 commented 1 year ago

I get the following Permission denied error when running this action locally on Windows 11 with nektos/act

[main/android]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2-composite-flutter-action.sh] user= workdir=
| /var/run/act/workflow/2-composite-flutter-action.sh: line 2: /var/run/act/actions/subosito-flutter-action@v2.10.0/setup.sh: Permission denied

I'm using this command to run

act -P macos-12=ghcr.io/catthehacker/ubuntu:runner-latest

And my docker container has the following file permissions for the subosito-flutter-action folder

$ cd /var/run/act/actions/subosito-flutter-action@v2.10.0
$ ls -al
total 40
drwxr-xr-x 5 runner runner 4096 Sep  9 20:11 .
drwxr-xr-x 4 root   root   4096 Sep  9 20:11 ..
drwxr-xr-x 4 runner runner 4096 Sep  9 20:11 .git
drwxr-xr-x 3 runner runner 4096 Sep  9 20:11 .github
-rw-rw-rw- 1 runner runner 1102 Sep  9 19:50 LICENSE
-rw-rw-rw- 1 runner runner 3947 Sep  9 20:11 README.md
-rw-rw-rw- 1 runner runner 2236 Sep  9 19:50 action.yml
-rw-rw-rw- 1 runner runner 5213 Sep  9 20:11 setup.sh
drwxr-xr-x 2 runner runner 4096 Sep  9 20:11 test

I tried chmoding the setup.sh file in the container directly, however it's reset each time the action is run

maple135790 commented 1 year ago

new to act i am using flutter and encountered the same issue is there any workarounds exist?

JaredHorwitz commented 1 year ago

@baconcheese113 the following workaround worked for me:

  1. Fork this repository
  2. Add a step to the Github action chmod +x setup.sh

My action.yml looks like:

runs:
  using: 'composite'
  steps:
    - id: chmodx
      run: chmod +x $GITHUB_ACTION_PATH/setup.sh
      shell: bash
    - id: flutter-action
      run: $GITHUB_ACTION_PATH/setup.sh -p -c '${{ inputs.cache-path }}' -k '${{ inputs.cache-key }}' -n '${{ inputs.flutter-version }}' -a '${{ inputs.architecture }}' ${{ inputs.channel }}
      shell: bash