Build job failing for unknown reason

I have configured two identical build jobs for my GitHub repo. The issue in my case is that only one build succeeds while the other fails on the exact same command. The command is simply an API request to GitHub. What is the cause of this failure?

Here’s the code snippet which is failing:

- "if [ $latest == 'true' ]; then\n  link=$(curl -s
  | grep \"/hugo_[0-9]\\.[0-9]*\\.*[0-9]_Linux-64bit.tar.gz\" | cut -d\\\" -f4)\nelse \n  link=\"${minVer}/hugo_${minVer}_Linux-64bit.tar.gz\"\nfi\n"
- wget $link -O hugo.tgz

Basically, $link is successfully declared in one job, while it isn’t in the other job. When $link is empty, the wget command fails and hence the build job as well.

Here are the necessary links:

You are making an anonymous GitHub API call. Such calls are limited to 60 requests per hour on all of Travis CI (because our builds share a limited number of IP addresses). I suggest adding your own API token to raise the limit to 5000/hour.

1 Like

Thanks, that worked. I had already added the API token but didn’t include it in the request.