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

Build error for v6.2.2 on github actions #1233

Closed
sukhjinder-kumar opened this issue Sep 13, 2023 · 6 comments
Closed

Build error for v6.2.2 on github actions #1233

sukhjinder-kumar opened this issue Sep 13, 2023 · 6 comments

Comments

@sukhjinder-kumar
Copy link

Describe the bug

Error in test site step in action GitHub, there is no problem with local usage. However, it is resolved if I revert back to HTML-proofer version 3.18

Expected behavior

Pass all tests and successful build.

Logs/Screenshots

Run bundle exec htmlproofer _site --disable-external --check-html --allow_hash_href
bundler: failed to load command: htmlproofer (/home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/bin/htmlproofer)
/home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:33:in `go': missing argument: --allow_hash_href (OptionParser::MissingArgument)
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/gems/html-proofer-4.4.3/bin/htmlproofer:11:in `<top (required)>'
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/bin/htmlproofer:25:in `load'
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/bin/htmlproofer:25:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.2/x[6](https://github.com/sukhjinder-kumar/blog/actions/runs/6170488144/job/16746851556#step:6:7)4/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli.rb:492:in `exec'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:2[7](https://github.com/sukhjinder-kumar/blog/actions/runs/6170488144/job/16746851556#step:6:8):in `run'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:4[8](https://github.com/sukhjinder-kumar/blog/actions/runs/6170488144/job/16746851556#step:6:9)5:in `start'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli.rb:28:in `start'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.[10](https://github.com/sukhjinder-kumar/blog/actions/runs/6170488144/job/16746851556#step:6:11)/libexec/bundle:45:in `block in <top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/friendly_errors.rb:[11](https://github.com/sukhjinder-kumar/blog/actions/runs/6170488144/job/16746851556#step:6:12)7:in `with_friendly_errors'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.10/libexec/bundle:33:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle:[25](https://github.com/sukhjinder-kumar/blog/actions/runs/6170488144/job/16746851556#step:6:26):in `load'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle:25:in `<main>'
Error: Process completed with exit code 1.

Environment

Command Version
ruby -v ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
gem -v 3.3.5
bundle -v Bundler version 2.4.10
bundle exec jekyll -v jekyll 4.3.2
bundle info jekyll-theme-chirpy jekyll-theme-chirpy (6.2.2)

Desktop

  • OS: Ubuntu 22.04
  • Browser: Chrome (Version 116.0.5845.140 (Official Build) (64-bit))
@Rootjhon
Copy link

--allow_hash_href => --allow-hash_href

@sukhjinder-kumar
Copy link
Author

Thank you for your comment. I noticed that in .github/workflow/pages-deploy.yml I had the old file. I updated that into a newer one. However, now I am getting this error during the test site. Is the message saying to remove \-\-disable-external=true \ from the pages-deploy.yml file?

Run bundle exec htmlproofer _site \
  bundle exec htmlproofer _site \
    \-\-disable-external=true \
    \-\-ignore-urls "/^http:\/\/[1](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:1)[2](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:2)7.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
  shell: /usr/bin/bash -e {0}
  env:
    GITHUB_PAGES: true
bundler: failed to load command: htmlproofer (/home/runner/work/blog/blog/vendor/bundle/ruby/[3](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:3).2.0/bin/htmlproofer)
/home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/gems/mercenary-0.[4](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:4).0/lib/mercenary/program.rb:33:in `go': needless argument: --disable-external=true (OptionParser::NeedlessArgument)
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/gems/html-proofer-3.19.4/bin/htmlproofer:11:in `<top (required)>'
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/bin/htmlproofer:2[5](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:5):in `load'
	from /home/runner/work/blog/blog/vendor/bundle/ruby/3.2.0/bin/htmlproofer:25:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.2/x[6](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:6)4/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli.rb:492:in `exec'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:2[7](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:7):in `run'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:4[8](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:9)5:in `start'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/cli.rb:28:in `start'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.[10](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:11)/libexec/bundle:45:in `block in <top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/bundler/friendly_errors.rb:[11](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:12)7:in `with_friendly_errors'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.10/libexec/bundle:33:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle:[25](https://github.com/sukhjinder-kumar/blog/actions/runs/6185195804/job/16790323404#step:6:26):in `load'
	from /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle:25:in `<main>'

@Rootjhon
Copy link

another file , /tools/test action: --allow_hash_href => --allow-hash_href

@sukhjinder-kumar
Copy link
Author

Please correct me if I am wrong. What you are saying is for the previous version of the repo. The current version (6.2.2), check this commit, has no --allow_hash_href.

  # test
  bundle exec htmlproofer "$SITE_DIR" \
    --disable-external \
    --check-html \
    --allow_hash_href

has been changed to

  # test
  bundle exec htmlproofer "$SITE_DIR" \
    --disable-external=true \
    --ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"

@Rootjhon
Copy link

@sukhjinder-kumar
Copy link
Author

Thank you for your help. It works now. I also made a mistake in the codebase in some other files (Gemfile, htmlproofer version was still set to 3.18).

Complete Solution -

  1. Change the htmlproofer version to 4.4 in Gemfile.
  2. Update .github/workflows/pages-deploy.yml file. The test site command is changed. Link of the updated file. Note don't change the file name to .yml.hook keep it .yml only.

If there are some issues still, try pages-deploy.yml from Rootjhon repo, in this case, I also copied tools folder too which has tools/test file that ig needs to be "sync?" with pages file.

shihtiy-tw added a commit to shihtiy-tw/shihtiy-tw.github.io that referenced this issue Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants