Skip to content

Bad context on version 6.x.x #301

Description

@76creates

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

I have GH action where I update the .npmrc file to include authentication, this file is existing prior to me updating it and it contains placeholder info.

Example:
original . npmrc

foo:=_authToken=

updated . npmrc in step prior to build

foo:=_authToken=123

When I run build with . as a context, and use COPY . . the contents of the .npmrc within a build is original file as opposed to updated one.

Since I have used @master Ive tried with @v6.3.0 and @v5.13.0, it fails on 6 and passes with 5 version.

Expected behaviour

.npmrc contents are:

foo:=_authToken=123

Actual behaviour

.npmrc contents are:

foo:=_authToken=

Repository URL

No response

Workflow run URL

No response

YAML workflow

...
      - name: Update npmrc
        run: echo '//npm.pkg.github.com:_authToken=${{ secrets.GHRC_REPO_TOKEN }}' > .npmrc

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

      - name: Login to GitHub Container Registry
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GHRC_REPO_TOKEN }}

      - name: Build and push
        env:
          IMAGE: ${{ env.IMAGE_NAME }}
          REPO: ${{ github.repository }}
          TAG: ${{ needs.opts.outputs.tag }}
          META_TAG: ${{ needs.opts.outputs.metaTag }}
        uses: docker/bake-action@v6.3.0
        with:
          targets: default
          push: false
...

Workflow logs

No response

BuildKit logs


Additional info

FROM node:18.20.4-alpine As builder

WORKDIR /app
COPY . .

# added to debug the issue
RUN cat .npmrc

RUN npm ci
RUN npm run build
RUN rm .npmrc

EXPOSE 3000
CMD [ "npm", "start" ]

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions