DomiStyle / docker-tor-browser

Tor Browser (in a browser)
https://hub.docker.com/r/domistyle/tor-browser
MIT License
75 stars 22 forks source link

Auto-update not working #35

Closed lawndoc closed 1 year ago

lawndoc commented 1 year ago

Seems to be an issue with the auto-update workflow at the step where we run curl to fetch the release info from GitHub's API. I won't have time to take a look at this today, if anyone else wants to play with it before I can, go ahead.

Now that I'm looking at it again with a fresh mind, I think it might also fail at the python3 step if Python 3 isn't installed. Not sure if it's installed by default on GitHub's runners or not.

lawndoc commented 1 year ago

According to GitHub's runner documentation, both curl and python3 should be installed.

lawndoc commented 1 year ago

I'm stumped right now. I added verbose output in this run, and it looks like curl is getting a successful 200 response from the server. Then the workflow immediately raises exit 1.

image

lawndoc commented 1 year ago

Aha, I've discovered something. If I remove the variable assignment before calling curl, it will run and exit normally. For some reason it looks like it doesn't like being in a string substitution...

If I don't save the output to a variable, it will parse the json as expected and return the latest version number.

image

However, as soon as I add a variable assignment around the curl <...> | python <...> statement, we get exit code 1 again. What the heck!

image

lawndoc commented 1 year ago

It looks like other people use curl in this way in their own workflow files, so why is it failing in ours?

lawndoc commented 1 year ago

I was looking at the wrong thing. It turns out the return code 1 was happening somewhere else, but the GitHub Actions output didn't make it clear which line was causing the error. In this case, it was the dpkg line where I expected it to return 1 when there was no updated needed. This would work in a bash script, but apparently that terminates the whole workflow in GitHub Actions.

That was subtle and frustrating lol.