Skip to content

Baseline file not picked up when running in DockerΒ #25

@alastairmontgomery1-nhs

Description

@alastairmontgomery1-nhs

Is there an existing issue for this?

  • I have searched the existing Issues

Current Behavior

The line to check for baseline json file doesn't work when running in Docker as the script looks for it where it would be in the Docker image not on the native file system.

  if [ -f "$dir/scripts/config/.gitleaks-baseline.json" ]; then
    cmd="$cmd --baseline-path $dir/scripts/config/.gitleaks-baseline.json"
  fi

When running in Docker $dir is set to '/workdir' so it isn't looking in the correct place for the baseline file.

Expected Behavior

Should be looking for it in the local repo path

Needs to be

  if [ -f "$PWD/scripts/config/.gitleaks-baseline.json" ]; then
    cmd="$cmd --baseline-path $dir/scripts/config/.gitleaks-baseline.json"
  fi

Steps To Reproduce

No response

Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Sensitive Information Declaration

  • I confirm that neither PII/PID nor sensitive data are included in this form

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions