Skip to content

Commit

Permalink
Pass build secrets to Snyk
Browse files Browse the repository at this point in the history
  • Loading branch information
wilson1000 committed Mar 7, 2024
1 parent 867207f commit 1c2121f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/snyk-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ jobs:
# Build the docker images for testing
- name: Container monitor ~ build FPM & Nginx Docker images
run: |
docker image build -t justice-fpm:snyk --target build-fpm .
docker image build --build-arg COMPOSER_USER="$COMPOSER_USER" --build-arg COMPOSER_PASS="$COMPOSER_PASS" -t justice-fpm:snyk --target build-fpm .
docker image build -t justice-nginx:snyk --target build-nginx .
env:
COMPOSER_USER: ${{ secrets.COMPOSER_USER }}
COMPOSER_PASS: ${{ secrets.COMPOSER_PASS }}

# Runs Snyk Container (Container and SCA) analysis.
- name: Container monitor ~ analyse
run: |
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ USER 82
FROM base-fpm AS build-fpm-composer

ARG COMPOSER_USER
ENV COMPOSER_USER $COMPOSER_USER
ARG COMPOSER_PASS

WORKDIR /var/www/html

Expand All @@ -40,7 +40,6 @@ COPY ./bin/composer-auth.sh /var/www/html/composer-auth.sh
RUN chmod +x /var/www/html/composer-auth.sh
RUN /var/www/html/composer-auth.sh


# non-root
USER 82

Expand All @@ -49,7 +48,7 @@ RUN composer install --no-dev --no-scripts --no-autoloader

COPY . .
RUN composer install --no-dev
RUN composer dump-autoload -o
RUN composer dump-autoload -o && rm -f auth.json

ARG regex_files='\(htm\|html\|js\|css\|png\|jpg\|jpeg\|gif\|ico\|svg\|webmanifest\)'
ARG regex_path='\(app\/themes\/clarity\/error\-pages\|app\/mu\-plugins\|app\/plugins\|wp\)'
Expand Down

0 comments on commit 1c2121f

Please sign in to comment.