koenrh / dnscontrol-action

Deploy your DNS configuration using GitHub Actions using DNSControl.
ISC License
79 stars 37 forks source link

Diactritics on Preview #102

Open misilot opened 1 year ago

misilot commented 1 year ago

Hello,

I am seeing unknown diacrtitics when it posts the preview text as GitHub comment. Any ideas on how to fix that?

******************** Domain: domain
1 correction
#1: 
�[31m- DELETE CNAME webhooks.domain domain. ttl=300�[0m

******************** Domain: domain2
1 correction
#1: 
�[31m- DELETE CNAME webhooks.domain domain. ttl=300�[0m
misilot commented 1 year ago

It doesn't seem to like the dash

- DELETE CNAME webhooks.domain domain. ttl=300
tlimoncelli commented 1 year ago

That looks like ESC codes to colorize the output. Try setting the env variable CI to "true" to disable colorization.

Oddly enough... according to https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables that variable will be set for you. Can you verify it is set?

Please share the output of: dnscontrol version

Thanks!

misilot commented 1 year ago

It doesn't look like the action supports dnscontrol version. It might be passing -config all the time per the output

Incorrect Usage: flag provided but not defined: -config

      - name: DNSControl version
        uses: koenrh/dnscontrol-action@v3
        with:
          args: version

Though looking at https://github.com/koenrh/dnscontrol-action/blob/main/Dockerfile#L11 it looks like it's 3.27.1 Ok, I found it in some output during the build process, it is "dnscontrol (2586e2b611c0054abbc25c15fe64a25d0ee7b51f) built 28 Feb 23 15:15 UTC"

Run echo "CI Value is : $CI"   # reference the default environment variables
CI Value is : true
tlimoncelli commented 1 year ago

This might be related to https://github.com/StackExchange/dnscontrol/issues/2354 -- The main DNSControl CI/CD pipeline is inserting hashes instead of versions.

misilot commented 1 year ago

This GHA https://github.com/koenrh/dnscontrol-action/blob/main/entrypoint.sh#L12-L15 always adds --config so it can't actually run version as an argument.

tlimoncelli commented 11 months ago

The �[0m codes you see are colorization ESC sequences. If you see them, then your CI system doesn't support them.

Add --no-colors (i.e. dnscontrol --no-colors preview) to disable colorization.

Normally this flag isn't needed because the colorization disables itself for non-interactive runs but that doesn't seem to work for many (most?) CI systems.