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

Remove PWD from provenance env #825

Merged
merged 4 commits into from
Sep 9, 2022
Merged

Conversation

ianlewis
Copy link
Member

@ianlewis ianlewis commented Sep 8, 2022

Updates #822

Remove PWD from the environment variables in provenance build steps as it is redundant with the given working directory. PWD is set when executing the command but is not included in the environment variables that are added to the buildConfig in the provenance.

Before:

"steps": [
    {
        "command": ["bash", "-c", "echo $STEP2"],
        "env": [
            "STEP2=fuga",
            "PWD=/home/user"
        ],
        "workingDir": "/home/user"
    },
    ...
]

After:

"steps": [
    {
        "command": ["bash", "-c", "echo $STEP2"],
        "env": [
            "STEP2=fuga"
        ],
        "workingDir": "/home/user"
    },
    ...
]

Signed-off-by: Ian Lewis ianlewis@google.com

Signed-off-by: Ian Lewis <ianlewis@google.com>
Ian Lewis added 2 commits September 8, 2022 05:09
Signed-off-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: Ian Lewis <ianlewis@google.com>
Copy link
Collaborator

@asraa asraa left a comment

Choose a reason for hiding this comment

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

LGTM -- CommandRunner contains posixEnv for Env but the CommandStep will render env without it for now. I see

Signed-off-by: Ian Lewis <ianlewis@google.com>
@ianlewis
Copy link
Member Author

ianlewis commented Sep 9, 2022

LGTM -- CommandRunner contains posixEnv for Env but the CommandStep will render env without it for now. I see

Yes. I think we should set the variable but the question is whether it needs to be included in the provenance.

@ianlewis ianlewis enabled auto-merge (squash) September 9, 2022 02:47
@ianlewis ianlewis merged commit d7bb090 into slsa-framework:main Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants