Skip to content

Commit 2e248ee

Browse files
Add troubleshooting section for dependabots and coverage upload (codacy#2474)
1 parent 150d6eb commit 2e248ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/coverage-reporter/troubleshooting-coverage-cli-issues.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,10 @@ If you're experiencing segmentation faults when uploading the coverage results d
145145
echo "$(dig +short api.codacy.com | tail -n1) api.codacy.com" >> /etc/hosts
146146
```
147147
148+
## I received the message: "Invalid configuration: Either a project or account API token must be provided or available in an environment variable" in a build from a commit created by Dependabot (Github)
149+
150+
When builds are triggered by Dependabot, they run with a read-only GITHUB_TOKEN and don’t have access to any secrets stored in GitHub Actions. This can break workflows — for example, the token may be missing and coverage reports can’t be uploaded to Codacy.
151+
152+
[See GitHub’s documentation for details.](https://docs.github.com/en/code-security/dependabot/troubleshooting-dependabot/troubleshooting-dependabot-on-github-actions#troubleshooting-failures-when-dependabot-triggers-existing-workflows)
153+
154+
If you still need to upload coverage from Dependabot’s pull requests, a workaround is to add an empty commit to those PRs. Because the commit comes from a regular user account, the workflow will then have access to the repository’s secrets, allowing the upload to succeed.

0 commit comments

Comments
 (0)