Skip to content

Bug: git.diff is not populated in CI on Github Actions #320

Description

@Brock-Gibson

When trying to write logic / rules around git.diff, the action is hanging and this debugging / warning i added never seems to get hit.

onGitHub {
        // Debug: Check if diff is available
        val diffContent = git.diff
        warn("DEBUG: Diff is ${if (diffContent.isNullOrEmpty()) "empty/null" else "available (${diffContent.length} chars)"}")
}

I am running in CI on Github Actions via this yml.

name: Danger

on:
  pull_request:
    types: [ synchronize, opened, reopened, edited ]

jobs:
  danger-kotlin:
    runs-on: ubuntu-latest
    name: "Run Danger"
    steps:
      - name: create app token
        uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.DANGER_APP_ID }}
          private-key: ${{ secrets.DANGER_APP_PRIVATE_KEY }}
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Danger
        uses: danger/kotlin@1.3.3
        with:
          dangerfile: danger/Dangerfile.df.kts
          args: --verbose
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DANGER_GITHUB_API_TOKEN: ${{ steps.app-token.outputs.token }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions