Skip to content

Commit ba366b7

Browse files
vbvictorLukacma
authored andcommitted
1 parent 504ae0d commit ba366b7

File tree

1 file changed

+12
-0
lines changed
  • .github/workflows/containers/github-action-ci-tooling

1 file changed

+12
-0
lines changed

.github/workflows/containers/github-action-ci-tooling/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ RUN apt-get update && \
3737
apt-get clean && \
3838
rm -rf /var/lib/apt/lists/*
3939

40+
# Create a new user with id 1001 as that is the user id that
41+
# Github Actions uses to perform the checkout action.
42+
RUN useradd gha -u 1001 -m -s /bin/bash
43+
RUN adduser gha sudo
44+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
45+
# Don't set USER gha right away because we still need to install packages
46+
# as root in 'ci-container-code-format' and 'ci-container-code-lint' containers
47+
4048

4149
FROM base AS ci-container-code-format
4250
ARG LLVM_VERSION
@@ -51,6 +59,8 @@ ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
5159
COPY llvm/utils/git/requirements_formatting.txt requirements_formatting.txt
5260
RUN pip install -r requirements_formatting.txt --break-system-packages && \
5361
rm requirements_formatting.txt
62+
USER gha
63+
WORKDIR /home/gha
5464

5565

5666
FROM base AS ci-container-code-lint
@@ -80,3 +90,5 @@ RUN apt-get update && \
8090
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
8191
RUN pip install -r requirements_linting.txt --break-system-packages && \
8292
rm requirements_linting.txt
93+
USER gha
94+
WORKDIR /home/gha

0 commit comments

Comments
 (0)