Skip to content

Commit

Permalink
use sudo --user
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 committed Jan 7, 2025
1 parent 70d7677 commit 25528b3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/actions/install-lxd/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@ runs:
shell: bash
run: |
sudo lxd init --auto
- name: Add user to lxd group
shell: bash
run: |
sudo usermod --append --groups lxd $USER
- name: Check lxd version
shell: bash
run: |
sg lxd -c 'lxc version'
# `newgrp` does not work in GitHub Actions; use `sudo --user` instead
# See https://github.com/actions/runner-images/issues/9932#issuecomment-2573170305
sudo --user "$USER" --preserve-env --preserve-env=PATH -- env -- lxc version'
# Docker sets iptables rules that interfere with LXD.
# https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker
- name: Apply Docker iptables workaround
Expand Down

0 comments on commit 25528b3

Please sign in to comment.