Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collect this as JSON, and display it in more structured way #435

Open
github-actions bot opened this issue Jun 7, 2024 · 2 comments
Open

collect this as JSON, and display it in more structured way #435

github-actions bot opened this issue Jun 7, 2024 · 2 comments
Assignees
Labels

Comments

@github-actions
Copy link

github-actions bot commented Jun 7, 2024

# TODO: collect this as JSON, and display it in more structured way

          echo "npx: $(npx --version)"
          echo "installing: $package..."
          export H="$(mktemp)"
          se="$(mktemp)"
          echo '{' >> "$H"
          js_output_temp="$(mktemp)"
          npx --yes --package "$package" -- renovate-config-validator --strict >"$js_output_temp" || true
          if grep -e "^ERROR: Found errors in configuration" "$js_output_temp"; then
            # hard error
            # TODO: collect this as JSON, and display it in more structured way
            lf=$'\n'
            {
              echo '```'
              echo "Error(s) has been occurred: ${lf}$(cat "$js_output_temp")"
              echo '```'
            } | gh pr comment -F - "${URL}"
            exit 1
          fi
          
          # let's do main part, but avoid pipefail for soft-error about migration
          ruby -e 'File.open(ENV[?H], ?a) {|r| while gets; puts $_; $> = r if $_.strip == "WARN: Config migration necessary" ;end; }' <"$js_output_temp"
          echo '}' >> "$H"
          
          # exit early if migration is not required
@KisaragiEffective
Copy link
Owner

それシェルだよって言おうと思ったけど、区別がつかないから仕方ないのか

@KisaragiEffective
Copy link
Owner

echo "Error(s) has been occurred: ${lf}$(cat "$js_output_temp")"
これ馬鹿っぽい。catはその次の行にあるべき

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant