scrutinizer-ci / ocular

CLI for uploading external code coverage data
https://scrutinizer-ci.com
41 stars 24 forks source link

Github Actions unable to send ocular data #60

Open gravataLonga opened 2 years ago

gravataLonga commented 2 years ago

Hello, i'm new at sending data to scrutinizer-ci and github actions, but i've some automation on my actions on github, but i'm getting same erro and can't putting work. I'm always get same error:


In RepositoryIntrospector.php line 39:
  Failed to retrieve commit parents. If you use a shallow git checkout, pleas  
  e checkout at least a depth of one.                                          
code-coverage:upload [--api-url API-URL] [--repository REPOSITORY] [--revision REVISION] [--format FORMAT] [--parent PARENT] [--] <coverage-file>
Error: Process completed with exit code 1.

This is my action:

./vendor/bin/ocular code-coverage:upload build/logs/clover.xml --format=php-clover --repository='g/gravataLonga/container' --revision=${{ github.event.pull_request.head.sha || github.sha }}

What i'm doing wrong?
Many thank for any help, probably this isn't best place, you can remove my issue.

Best Regards, Jonathan Fontes

live627 commented 1 year ago
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0

https://github.com/live627/phpunit-garbage-collector/blob/719a52abb1e8c4f7dda3321083c4e3cca29f4c11/.github/workflows/php.yml#L15-L17

williamdes commented 3 months ago

Fetch depth 10 works fine too and costs less. I recommend this for my GitHub action: https://github.com/sudo-bot/action-scrutinizer