Skip to content

Commit 9237a0c

Browse files
committed
fix: When --init none is used, only users who can elevate to sudo privileges can run Nix
1 parent 50b4b67 commit 9237a0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ami-release-nix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Run checks if triggered manually
5757
if: ${{ github.event_name == 'workflow_dispatch' }}
5858
run: |
59-
SUFFIX=$(. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix run nixpkgs#yq -- '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/')
59+
SUFFIX=$(sudo -i nix run nixpkgs#yq -- '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/')
6060
if [[ -z $SUFFIX ]] ; then
6161
echo "Version must include non-numeric characters if built manually."
6262
exit 1
@@ -67,7 +67,7 @@ jobs:
6767

6868
- name: Generate common-nix.vars.pkr.hcl
6969
run: |
70-
PG_VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml)
70+
PG_VERSION=$(sudo -i nix run nixpkgs#yq -- '.postgres_release["postgres${{ matrix.postgres_version }}"]' ansible/vars.yml)
7171
echo "postgres-version = \"$PG_VERSION\"" > common-nix.vars.pkr.hcl
7272
7373
- name: Build AMI stage 1

0 commit comments

Comments
 (0)