Skip to content

Action fails to run with Github Enterprise using a self-signed certificate #122

Open
@jwilkicki

Description

@jwilkicki

Describe the bug

We have an on-premise Github Enterprise server with a self-signed TLS certificate. When trying to run the action with a configuration to push the change to a PR, we get an error about a self-signed certificate in the certificate chain. (I changed the URL of the server in the log to a dummy value for purposes of posting this report).

I've worked around similar issues in the past by creating my own Docker image based on the upstream project that includes our certificate. Unfortunately, this action doesn't allow the image to be overridden, so I can't do that here. I think adding the ability to override the image would be sufficient for our scenario.

How can we reproduce it?

Log output:

Run terraform-docs/gh-actions@v1
  with:
    working-dir: .
    config-file: .terraform-docs.yml
    git-push: true
    atlantis-file: disabled
    find-dir: disabled
    recursive: false
    recursive-path: modules
    output-format: markdown table
    output-method: inject
    output-file: README.md
    template: <!-- BEGIN_TF_DOCS -->
  {{ .Content }}
  <!-- END_TF_DOCS -->
    indention: 2
    git-commit-message: terraform-docs: automated action
    git-push-sign-off: false
    fail-on-diff: false
  
/usr/local/bin/docker run --name quayioterraformdocsghactions100_370836 --label 60e226 --workdir /github/workspace --rm -e "INPUT_WORKING-DIR" -e "INPUT_CONFIG-FILE" -e "INPUT_GIT-PUSH" -e "INPUT_ATLANTIS-FILE" -e "INPUT_FIND-DIR" -e "INPUT_RECURSIVE" -e "INPUT_RECURSIVE-PATH" -e "INPUT_OUTPUT-FORMAT" -e "INPUT_OUTPUT-METHOD" -e "INPUT_OUTPUT-FILE" -e "INPUT_TEMPLATE" -e "INPUT_ARGS" -e "INPUT_INDENTION" -e "INPUT_GIT-PUSH-USER-NAME" -e "INPUT_GIT-PUSH-USER-EMAIL" -e "INPUT_GIT-COMMIT-MESSAGE" -e "INPUT_GIT-PUSH-SIGN-OFF" -e "INPUT_FAIL-ON-DIFF" -e "INPUT_WORKING_DIR" -e "INPUT_ATLANTIS_FILE" -e "INPUT_FIND_DIR" -e "INPUT_RECURSIVE_PATH" -e "INPUT_OUTPUT_FORMAT" -e "INPUT_OUTPUT_METHOD" -e "INPUT_OUTPUT_FILE" -e "INPUT_GIT_PUSH" -e "INPUT_GIT_COMMIT_MESSAGE" -e "INPUT_CONFIG_FILE" -e "INPUT_FAIL_ON_DIFF" -e "INPUT_GIT_PUSH_SIGN_OFF" -e "INPUT_GIT_PUSH_USER_NAME" -e "INPUT_GIT_PUSH_USER_EMAIL" -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_EVENT_PATH" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "GITHUB_ACTION" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/runner/_work/_temp/_github_home":"/github/home" -v "/runner/_work/_temp/_github_workflow":"/github/workflow" -v "/runner/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/runner/_work/terraform-aws-ghactions/terraform-aws-ghactions":"/github/workspace" quay.io/terraform-docs/gh-actions:1.0.0
fatal: unable to access 'https://github.example.com/development/terraform-aws-ghactions/': SSL certificate problem: self signed certificate in certificate chain
::debug working_dir=.
::debug config_file=.terraform-docs.yml
::debug output_mode=inject
::debug output_file=README.md
::debug terraform-docs markdown table --config .terraform-docs.yml --output-mode inject --output-file README.md --output-template <!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS --> .
README.md updated successfully
::debug No change in ./ detected
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
::debug Following files will be committed
M  README.md
[docs 848c5ad] terraform-docs: automated action
 1 file changed, 40 insertions(+), 1 deletion(-)
fatal: unable to access 'https://github.example.com/development/terraform-aws-ghactions/': SSL certificate problem: self signed certificate in certificate chain

Environment information

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