Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds linter warning for using variables defined in parent stages #4935

Closed
wants to merge 1 commit into from

Conversation

daghack
Copy link
Collaborator

@daghack daghack commented May 16, 2024

This adds a linter warning for the case where a build arg is declared, and then later used in a child stage without being redeclared in that stage. For example:

RUN echo "Building version"
ARG username=foo
RUN echo "declared username: $username"

FROM one AS two
# Causes the lint warning
RUN echo "out of scope arg username: $username, define ARG in current stage to use it"

@daghack daghack self-assigned this May 17, 2024
@daghack daghack marked this pull request as ready for review May 17, 2024 02:26
@daghack daghack marked this pull request as draft May 17, 2024 22:08
@thompson-shaun thompson-shaun modified the milestone: v0.14.0 May 28, 2024
@daghack daghack closed this Jul 2, 2024
@daghack daghack deleted the out-of-scope-arg branch July 2, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants