github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Add input to disable info logging

Open jezdez opened this issue 4 years ago • 5 comments

Description of problem

When using the GitHub action in a public repo, it prints out the possibly "private" git remote URL.

How reproducible

Just use the Dokku GitHub Action.

Steps to Reproduce

  1. Configure a public repo to deploy to Dokku using the GitHub Action
  2. Specify the remote git URL using an encrypted environment variable
  3. See the parsed remote git URL in the action log

Actual Results

See the parsed SSH host and port in the GitHub action log.

Expected Results

Have an optional input to disable the printing of any output (e.g. via a flag in log-info in dokku/ci-docker-image).

jezdez avatar Mar 23 '21 09:03 jezdez

If it is secret, why not specify it via a github secret? Those get redacted automatically from output.

josegonzalez avatar Mar 23 '21 18:03 josegonzalez

If it is secret, why not specify it via a github secret? Those get redacted automatically from output.

I did, but https://github.com/dokku/ci-docker-image/blob/4661c62a16ba6a77336c043b44dda37d4f6b9cf0/bin/setup-ssh#L26 will make this moot and print the parsed git remote URL.

jezdez avatar Mar 23 '21 19:03 jezdez

Ah. We can just drop printing the host?

josegonzalez avatar Mar 23 '21 19:03 josegonzalez

Ah. We can just drop printing the host?

Yeah, there is some more info afterwards, which I'm not sure where it comes from:

Generating SSH_HOST_KEY from ssh-keyscan against example.com:22
# example.com:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
# example.com:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
# example.com:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
# example.com:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
# example.com:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2

and then its resolved IP as well

Pushing to Dokku Host
ECDSA host key for IP address '111.222.333.444' not in list of known hosts.

jezdez avatar Mar 23 '21 19:03 jezdez

https://github.com/dokku/ci-docker-image/blob/4661c62a16ba6a77336c043b44dda37d4f6b9cf0/bin/setup-ssh#L27

that line can probably be silenced somehow to not output the domain

https://github.com/dokku/ci-docker-image/blob/4661c62a16ba6a77336c043b44dda37d4f6b9cf0/bin/dokku-deploy#L71

Is there a command we can use to add the host to known_hosts?

josegonzalez avatar Mar 23 '21 20:03 josegonzalez

If you add your IP as a github secret and use it in the git_remote_url option, it'll be omitted

image

Xetera avatar Apr 08 '23 16:04 Xetera

Hi, I got similar needs.

I tried using --quiet git push flags without success.

            - name: Push to dokku
              uses: dokku/github-action@master
              with:
                  git_push_flags: '-q'
                  git_remote_url: ${{ secrets.GIT_REMOTE_URL }}
                  ssh_private_key: ${{ secrets.SSH_DOKKU_PRIVATE_KEY }}
                  branch: main

But git push output is still there ...

qdequippe avatar Nov 30 '23 11:11 qdequippe

@qdequippe open up a different issue if your problem is that the git push is still verbose.

I think if the workaround for @Xetera is reasonable - if annoying. Happy to take a PR to fix this otherwise, but closing for now.

josegonzalez avatar Dec 09 '23 18:12 josegonzalez