question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove `sudo` requirement in order to make the action work with act

See original GitHub issue

Hi, I’m trying to run my Playwright GitHub Actions locally in order to generate image snapshots without the issues produced by cross-platform inconsistencies.

To run my actions locally I’m using act, but I’m having a problem because of the lack of sudo support in the ubuntu-latest act image. (the only working one is the complete nektos/act-environments-ubuntu:18.04 image, but it’s 18gb)

This is my action config:

jobs:
  functional-chromium:
    name: Chromium Functional Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        env:
          RUNNER_TEMP: '/tmp/' # this is needed just to make `act` work
      - uses: microsoft/playwright-github-action@v1
      - uses: bahmutov/npm-install@v1
      - run: npm run test:functional
        env:
          BROWSER: chromium
          CI: true

Would it be possible to remove sudo from the required executables? Or do you have other alternatives to run this action locally?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DanJohnstonArmorycommented, Nov 15, 2020

Was this ever worked on? I’m running into the same issue [E2E Tests/e2e] ☁ git clone 'https://github.com/microsoft/playwright-github-action' # ref=v1 [E2E Tests/e2e] 🐳 docker cp src=/Users/danjohnston/.cache/act/microsoft-playwright-github-action@v1 dst=/actions/ [E2E Tests/e2e] ❗ ::error::Unable to locate executable file: sudo. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

0reactions
mxschmittcommented, Jun 16, 2021

This should be fixed with the Playwright CLI, which has a feature integrated of installing the specific browser dependencies: https://playwright.dev/docs/cli#install-system-dependencies

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to stop having to write 'sudo' for every little thing ...
Two options come to my mind: Own the directory you want by using chown : sudo chown your_username directory.
Read more >
Unix/Linux Privilege Management: Should You Sudo?
Whenever a user tries to install, remove, or change any piece of software, they must have the root privileges to perform such tasks....
Read more >
Yesterday I Learned: You can remove sudo : r/linux - Reddit
I quickly set a password and re-ran the command, and sudo actually uninstalled! You can still become root, you just have to use...
Read more >
Execute sudo without Password? - Ask Ubuntu
Save and close the sudoers file (if you haven't changed your default terminal editor (you'll know if you have), press Ctl + x...
Read more >
root login or sudo user for server administration?
Most security guides recommend disabling root SSH, primarily because it forces you to allow-list a user permission to do something. There's a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found