mpalmer / action-validator

Tool to validate GitHub Action and Workflow YAML files
GNU General Public License v3.0
277 stars 23 forks source link

Installation via asdf failing #21

Closed thehenrymcintosh closed 1 year ago

thehenrymcintosh commented 1 year ago

Using a Mac M1, Big Sur 11.7.2 with asdf installed via Homebrew.

Trying to install action-validator with asdf install leads to this message:

Downloading [action-validator] from https://github.com/mpalmer/action-validator/releases/download/v0.2.1/action-validator_darwin_amd64
darwin_arm64 to /var/folders/zc/9h_9mmbj6cv0znv9fn_svwy00000gp/T/asdf_XXXXXXXX.zM7psm31/action-validator_0.2.1
curl: (3) URL using bad/illegal format or missing URL

Has anyone encountered this before?

mpalmer commented 1 year ago

It'll almost certainly be related to the recent changes to the asdf plugin for arm64 support. What's weird is that the URL it's printing out is valid, so that error message from curl feels a bit misleading.

The best thing to try is to run the install script by hand, with bash debug tracing turned on. Something like this should do the trick:

ASDF_INSTALL_TYPE=x ASDF_INSTALL_VERSION=0.2.1 ASDF_INSTALL_PATH=/tmp/asdf-tmp /bin/bash -x ~/.asdf/plugins/action-validator/bin/install

(Assuming that your asdf dir is ~/.asdf)

If you can paste the output of that command into this issue, it should tell me enough about what's going on to be able to track down the problem.

justinshaw commented 1 year ago

Would you mind providing that command again? Not sure if it's just me, but it's blank. Happy to provide the output as I'm hitting the same problem

mpalmer commented 1 year ago

Whups, pasted on the wrong line. I've edited the above comment so that the command actually displays this time. Proofreading ftw... :facepalm:

justinshaw commented 1 year ago

No problem, thanks for updating. Here ya go:

$ ASDF_INSTALL_TYPE=x ASDF_INSTALL_VERSION=0.2.1 ASDF_INSTALL_PATH=/tmp/asdf-tmp /bin/bash -x ~/.asdf/plugins/action-validator/bin/install
+ set -euo pipefail
+ github_coordinates=mpalmer/action-validator
+ tool_name=action-validator
++ mktemp -d -t asdf_XXXXXXXX
+ tmp_download_dir=/var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz
+ trap 'rm -rf "${tmp_download_dir}"' EXIT
+ install_tool x 0.2.1 /tmp/asdf-tmp /var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz action-validator
+ local version=0.2.1
+ local install_path=/tmp/asdf-tmp
+ local tmp_download_dir=/var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz
+ local binary_name=action-validator
+ local platform
+ local bin_install_path=/tmp/asdf-tmp/bin
+ local binary_path=/tmp/asdf-tmp/bin/action-validator
+ local download_url
+ local download_path
++ get_platform
+++ uname
++ [[ Darwin == \L\i\n\u\x ]]
+++ uname
++ [[ Darwin == \D\a\r\w\i\n ]]
++ echo darwin_amd64
+++ uname -m
++ [[ x86_64 == \x\8\6\_\6\4 ]]
++ echo darwin_amd64
+ platform='darwin_amd64
darwin_amd64'
++ get_download_url 0.2.1 'darwin_amd64
darwin_amd64' action-validator
++ local version=0.2.1
++ local 'platform=darwin_amd64
darwin_amd64'
++ local binary_name=action-validator
++ local filename
+++ get_filename 'darwin_amd64
darwin_amd64'
+++ local 'platform=darwin_amd64
darwin_amd64'
+++ echo 'action-validator_darwin_amd64
darwin_amd64'
++ filename='action-validator_darwin_amd64
darwin_amd64'
++ echo 'https://github.com/mpalmer/action-validator/releases/download/v0.2.1/action-validator_darwin_amd64
darwin_amd64'
+ download_url='https://github.com/mpalmer/action-validator/releases/download/v0.2.1/action-validator_darwin_amd64
darwin_amd64'
++ get_filename 0.2.1 'darwin_amd64
darwin_amd64' action-validator
++ local platform=0.2.1
++ echo action-validator_0.2.1
+ download_path=/var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz/action-validator_0.2.1
+ echo 'Downloading [action-validator] from https://github.com/mpalmer/action-validator/releases/download/v0.2.1/action-validator_darwin_amd64
darwin_amd64 to /var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz/action-validator_0.2.1'
Downloading [action-validator] from https://github.com/mpalmer/action-validator/releases/download/v0.2.1/action-validator_darwin_amd64
darwin_amd64 to /var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz/action-validator_0.2.1
+ curl -Lo /var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz/action-validator_0.2.1 'https://github.com/mpalmer/action-validator/releases/download/v0.2.1/action-validator_darwin_amd64
darwin_amd64'
curl: (3) URL using bad/illegal format or missing URL
+ rm -rf /var/folders/km/y9dhrw950q770kxym9sts_zr0000gn/T/asdf_XXXXXXXX.ZmYpQWBz
mpalmer commented 1 year ago

Ooooh, yeah, I see what I did there. Herp-a-derp. I've just pushed a commit that should fix it. Update the asdf plugin (asdf update action-validator) and try again, and if it is, indeed, fixed, let me know and I'll close this off.

justinshaw commented 1 year ago

Nice! Looks like it's good to go, thanks very much :)

Side note, it doesn't recognize the --version flag but that's unrelated to this issue

$ action-validator --version
error: Found argument '--version' which wasn't expected, or isn't valid in this context

        Did you mean '--verbose'?

        If you tried to supply `--version` as a value rather than a flag, use `-- --version`

USAGE:
    action-validator --verbose <path_to_action_yaml>

For more information try --help
mpalmer commented 1 year ago

Thanks for confirming the fix; I'll close off this issue.

I don't think I've ever documented that --version was supposed to work, but it's pretty straightforward to add, so I've done that in git; it'll go into the next minor release (I don't think it's worth a separate release just for that, but open to being persuaded otherwise).

justinshaw commented 1 year ago

Makes sense to me! I tried --version just because it’s in the steps in the README

mpalmer commented 1 year ago

I tried --version just because it’s in the steps in the README

Oh wow, it is too. I've fixed that, because it's not as helpful as calling --help.