facebook / pyre-action

GitHub Action for Pyre
MIT License
17 stars 11 forks source link

Error: repository not enabled for code scanning #4

Open Karim-53 opened 1 year ago

Karim-53 commented 1 year ago

Hi,

I am trying to run Pyre on a private repo. But I get this error: Error: repository not enabled for code scanning

I tried to enable code scanning, but it is not that easy: image

Is Run github/codeql-action/upload-sarif@v2 really mandatory to check the python code style?

scherersebastian commented 7 months ago

Hi @Karim-53 you can fork this repo and remove the Sarif specific steps from https://github.com/facebook/pyre-action/blob/main/action.yml

    - name: Run Pyre
      run: |
        cd "$REPO_DIR" || exit 1
        pyre --noninteractive --output=sarif check > sarif.json
      shell: bash
      env:
        REPO_DIR: ${{inputs.repo-directory}}

    - name: Saving results in SARIF
      if: always()
      uses: actions/upload-artifact@v2
      with:
        name: SARIF Results
        path: ${{inputs.repo-directory}}/sarif.json
        if-no-files-found: ignore

    - name: Upload SARIF Results
      if: always()
      uses: github/codeql-action/upload-sarif@v2
      with:
        sarif_file: ${{inputs.repo-directory}}/sarif.json

And configure a different pyre / pysa reporting format or just output the sarif.json to the console.