In versions before 1.5.2, when you want to access a file or directory outside of its original location, you might end up with an error message like this: Access denied. The solution to this problem must be applied in both GitHub and Travis CI. You can do so by updating the grunt.file task so that it uses the --base flag to specify the base URL for the project. The updated task should look like this: 1 2 3 grunt . file { "task" : "default" , "base" : "https://github.com/YOUR_USER/repo.git" , } In this case, the base URL is set to the root of the project. Alternatively, you can specify the base URL to a specific branch. To do so, use the --branch flag. The task will then look like this: 1 2 3 grunt . file { "task" : "default" , "branch" : "master" , "base" : "https://github.com/YOUR_USER/repo.git" , } In this case, the base URL will be set to the root of the master branch. Alternatively, you can specify the base URL to a specific commit. The task will then look like this: 1 2 3 grunt . file { "task" : "default" , "commit" : "e9a0e0a" , "base" : "https://github.com

Handle custom environment variables

One of the most popular options for automation is using environments. Environments are variables that are set by the user to provide a specific context to your build. You can use them in any task, but they're best used in tasks that require the user to input values into a text file or specify command line options.
This option allows you to create your own environment variables in your project's configuration. This can be done by creating an env.json file like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "global" :{ "FOO" : "bar" }, "environment-specific" :{ "FOO_1" : "baz" , } }

Troubleshooting

When you encounter errors on Travis CI, here are some common troubleshooting steps.
Asking for help
If you run into an error that you’ve never seen before and don’t know how to fix, it can be helpful to ask for help from the community. Using the issue tracker, you can submit a new issue with a description of your problem and include a link to your build log. If the problem persists, other people in the community may be able to provide feedback or suggest solutions.
Checking the logs
If a build fails and you think it might have been caused by one of these problems, check out your log files. You'll find them at this location: https://ci.travis-ci.org/YOUR_USER/repo/. The logs show a history of all commands that have been run during the build process and information about what they produced. If something doesn't seem right, take a look at the logs and see if there's anything you missed or misunderstood.

Do not use a personal repository for CI

GitHub has introduced a new behavior in the last few days where you can use a personal repository for CI. This is not recommended as it may impact your project's security, which should be paramount to anyone creating an open source project.

Timeline

Published on: 04/12/2022 21:15:00 UTC
Last modified on: 04/20/2022 19:01:00 UTC

References