action-detect-secrets icon indicating copy to clipboard operation
action-detect-secrets copied to clipboard

reviewdog detect-secrets fails with: "fail to get diff: failed to get merge-base commit: exit status 128"

Open sammcj opened this issue 1 year ago • 2 comments

We're having an issue with one of our repos where the reviewdog detect-secrets action fails with a less-than-helpful error message:

fail to get diff: failed to get merge-base commit: exit status 128

  • detect-secrets with the same parameters works fine on the command line and only fails when running through the Action.
  • All other workflows / Git(hub) actions are operating normally.
  • No recent changes to how we're using the Action.

Is there some way to see why the Action is failing with this message?


I'm sorry to say that I can't give an example repo as it's a private / internal repository, but here is the full log:

Run reviewdog/action-detect-secrets@master
  with:
    github_token: ***
    reporter: github-pr-review
    fail_on_error: false
    level: warning
    filter_mode: added
    detect_secrets_flags: --exclude-files='node_modules'
  --exclude-files='dist'
  --exclude-files='public'
  --exclude-files='.env.template'
  --exclude-files='*secrets*baseline'
   --exclude-lines='CHECKSUM'
  --exclude-lines='MOCKING'
  --exclude-lines='GOOGLE_API_KEY'
  --exclude-lines='google-api-key'
  --exclude-lines='NODE_OPTIONS'
  --exclude-lines='http://localhost'
  --exclude-lines='#*tag=v'
  --exclude-lines='secrets*inherit'
  --exclude-lines='AwsAccountId'
   
    name: detect-secrets
    workdir: .
    skip_audited: false
    verbose: false
  env:
    EXCLUDE_LINES: --exclude-lines='CHECKSUM'
  --exclude-lines='MOCKING'
  --exclude-lines='GOOGLE_API_KEY'
  --exclude-lines='google-api-key'
  --exclude-lines='NODE_OPTIONS'
  --exclude-lines='http://localhost'
  --exclude-lines='#*tag=v'
  --exclude-lines='secrets*inherit'
  --exclude-lines='AwsAccountId'
  
    EXCLUDE_FILES: --exclude-files='node_modules'
  --exclude-files='dist'
  --exclude-files='public'
  --exclude-files='.env.template'
  --exclude-files='*secrets*baseline'
  
    REVIEWDOG_GITHUB_API_TOKEN: ***
    GITHUB_TOKEN: ***
/usr/bin/docker run --name f910b53783ef33d21c404989328f33361f3cbb_b1d5d0 --label f910b5 --workdir /github/workspace --rm -e "EXCLUDE_LINES" -e "EXCLUDE_FILES" -e "REVIEWDOG_GITHUB_API_TOKEN" -e "GITHUB_TOKEN" -e "INPUT_GITHUB_TOKEN" -e "INPUT_REPORTER" -e "INPUT_FAIL_ON_ERROR" -e "INPUT_LEVEL" -e "INPUT_FILTER_MODE" -e "INPUT_DETECT_SECRETS_FLAGS" -e "INPUT_NAME" -e "INPUT_WORKDIR" -e "INPUT_REVIEWDOG_FLAGS" -e "INPUT_BASELINE_PATH" -e "INPUT_SKIP_AUDITED" -e "INPUT_VERBOSE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/redacted-repo-name/redacted-repo-name":"/github/workspace" f910b5:3783ef33d21c404989328f33361f3cbb
1.4.0
time=2024-04-30T22:13:56.486Z level=INFO msg="fallback to use git command"
reviewdog: fail to get diff: failed to get merge-base commit: exit status 128

sammcj avatar Apr 30 '24 22:04 sammcj

This may be fix by https://github.com/reviewdog/action-detect-secrets/pull/64.

massongit avatar Apr 30 '24 22:04 massongit

Interesting, thanks @massongit, I'll watch that PR and report back once it's merged as to if the problem is resolved.

sammcj avatar Apr 30 '24 22:04 sammcj