Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
contents: write
packages: write
id-token: write # needed for provenance attestation
attestations: write # needed for provenance attestation
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using secrets.GITHUB_TOKEN is correct, but note that github.token is also valid syntax in GitHub Actions. However, secrets.GITHUB_TOKEN is the more explicit and widely recommended approach for clarity and consistency.

Copilot uses AI. Check for mistakes.

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Export build information
run: |
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
cache-to: type=gha,mode=max
# outputs: type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=${{ inputs.push-image }}
build-args: |
GH_TOKEN=${{ secrets.GH_PAT }}
GHI_TOKEN=${{ secrets.GH_PAT }}
PRIVATE_REPO_HOST=github.com/scality
BUILD_DATE=${{ fromJson(steps.meta.outputs.json)['org.opencontainers.image.created'] }}
GIT_COMMIT=${{ github.sha }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build the manager binary
FROM golang:1.24 AS builder

ARG GH_TOKEN
ARG GHI_TOKEN

Check warning on line 4 in Dockerfile

View workflow job for this annotation

GitHub Actions / build / build

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "GHI_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 4 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "GHI_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

ARG PRIVATE_REPO_HOST=github.com/scality

Expand All @@ -12,8 +12,8 @@

RUN go env -w GOPRIVATE=${PRIVATE_REPO_HOST}

RUN if [ -z "$GH_TOKEN" ]; then echo "GH_TOKEN is missing"; exit 1; fi && \
git config --global url."https://oauth2:${GH_TOKEN}@${PRIVATE_REPO_HOST}".insteadOf "https://${PRIVATE_REPO_HOST}"
RUN if [ -z "$GHI_TOKEN" ]; then echo "GHI_TOKEN is missing"; exit 1; fi && \
git config --global url."https://oauth2:${GHI_TOKEN}@${PRIVATE_REPO_HOST}".insteadOf "https://${PRIVATE_REPO_HOST}"

# Copy the Go Modules manifests
COPY go.mod go.mod
Expand Down