Skip to content

Commit

Permalink
Prefer checking user over touching a file
Browse files Browse the repository at this point in the history
  • Loading branch information
brrygrdn committed Sep 10, 2021
1 parent 6d04a3c commit 8aae45a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ FROM dependabot/dependabot-core

# Temporarily switch to root user in order to install packages
USER root
RUN touch /etc/dependabot-core-dev
RUN apt-get update \
&& apt-get install -y vim strace ltrace gdb shellcheck \
&& rm -rf /var/lib/apt/lists/*
Expand Down
3 changes: 2 additions & 1 deletion bin/dry-run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

# rubocop:disable Style/GlobalVars

unless File.exist?("/etc/dependabot-core-dev")
require "etc"
unless Etc.getpwuid(Process.uid).name == "dependabot"
puts <<~INFO
bin/dry-run.rb is only supported in a developerment container.
Expand Down

0 comments on commit 8aae45a

Please sign in to comment.