GitHubSecurityLab / actions-permissions

GitHub token permissions Monitor and Advisor actions
MIT License
256 stars 20 forks source link

Sudo error if job runs in container #23

Open Th3S4mur41 opened 1 year ago

Th3S4mur41 commented 1 year ago

We have multiple jobs running in docker containers like node.

jobs:
  myJob:
    runs-on: [self-hosted, linux]
    container: node:lts-bullseye

    steps:
      - uses: GitHubSecurityLab/actions-permissions/monitor@v1
        with:
          config: ${{ vars.PERMISSIONS_CONFIG }}
      - ...

Adding the monitor as a first step to those jobs throws the following error.

Run GitHubSecurityLab/actions-permissions/monitor@v1
  with:
    token: ***
    debug: false
/usr/bin/docker exec  9bc858ec98d1[2](https://github.com/eviden-parallel/actions/actions/runs/6001487624/job/16275802651#step:3:2)90fa22a[3](https://github.com/eviden-parallel/actions/actions/runs/6001487624/job/16275802651#step:3:3)8b13c69d[5](https://github.com/eviden-parallel/actions/actions/runs/6001487624/job/16275802651#step:3:6)9dbdeb5[6](https://github.com/eviden-parallel/actions/actions/runs/6001487624/job/16275802651#step:3:7)c3f1ed58001ab956a[7](https://github.com/eviden-parallel/actions/actions/runs/6001487624/job/16275802651#step:3:8)1c2913ab sh -c "cat /etc/*release | grep ^ID"
setup.sh: line 75: sudo: command not found

Error: Exited with code 127