Github-Action Qodana can't clone a private repo

272 views Asked by At

I'm attempting to use Qodana with a GitHub Action for a PHP Symfony project.

I can't find a way to install a vendor from a private repository. I use everything from my CI that works

Failed to download xx/xx-bundle from dist: The "https://api.github.com/repos/xx/xx-bundle/zipball/xx" file could not be downloaded (HTTP/2 404 ):
{"message":"Not Found","documentation_url":"https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip"}
    Now trying to download from source

Then I have

 git was not found in your PATH, skipping source download  

github action

jobs:
  qodana:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - name: Install SSH key
        uses: shimataro/ssh-key-action@v2
        with:
          key: ${{ secrets.SSH_KEY }}
          known_hosts: ${{ secrets.KNOWN_HOSTS }}
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.2'
          tools: composer:v2
      - name: 'Qodana Scan'
        uses: JetBrains/[email protected]
        with:
          use-caches: true
        env:
          COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{secrets.GITHUB_TOKEN}}"} }'
          QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

qodana conf:

bootstrap: |+
  set -eu
  APP_ENV=prod composer install --optimize-autoloader --no-dev --ignore-platform-reqs

What's the best way to use Qodana with Symfony and private bundle?

1

There are 1 answers

1
Rodj On BEST ANSWER

It is not necessary to run Composer in the Qodana container. If you already have a similar job configured and it works, you can reuse it in the Qodana job. If it's a separate step "Install dependencies" with APP_ENV=prod composer install --optimize-autoloader --no-dev --ignore-platform-reqs , vendor then will be reused by Qodana.