codacy / codacy-coverage-reporter-action

GitHub Action for the codacy-coverage-reporter
Other
56 stars 15 forks source link

[TCE-978] Pull request branch getting "Commit not found" status #85

Open arahlf opened 1 month ago

arahlf commented 1 month ago

I'm trying to use this GH action within a pull request workflow. The coverage upload action succeeds, but within the Codacy dashboard under the code coverage settings I see failures about "Commit not found" under that "Test your integration" section. I think this is because the commit sha being sent up by the GH action is of the pull request merge commit rather than the head commit sha of the branch. Here's an abbreviated version of my workflow:

name: Code PR Gate

on:
  pull_request:
    branches:
      - main
      - develop

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
      - uses: actions/setup-java@v2
        timeout-minutes: 10
        with:
          java-version: 11
          distribution: 'temurin'
      - uses: gradle/gradle-build-action@v2
        id: gradle
        with:
          arguments: build
      - name: Run codacy-coverage-reporter
        uses: codacy/codacy-coverage-reporter-action@v1.3
        with:
          project-token: ${{ secrets.CODACY_TOKEN }}
          coverage-reports: build/reports/jacoco/test/jacocoTestReport.xml

It seems like I might be running into the same issue that should have been resolved here but I'm not certain: https://github.com/codacy/codacy-coverage-reporter-action/issues/67

Am I doing something wrong or overlooking something?

github-actions[bot] commented 1 month ago

Internal ticket created : TCE-978