danger / danger-js

⚠️ Stop saying "you forgot to …" in code review
http://danger.systems/js/
MIT License
5.29k stars 367 forks source link

[BUG] Danger not giving back response in PR #1203

Open ruxiang05 opened 2 years ago

ruxiang05 commented 2 years ago

Describe the bug Danger not giving back response in PR. It gets stuck on Expected — Waiting for status to be reported. To Reproduce Danger passes locally and when running in the terminal with danger pr. The only issue is on Github PR view.

Expected behavior Danger passes if all subprocesses are successful.

Screenshots If applicable, add screenshots to help explain your problem.

Your Environment This happens on a PR where dependabot is updating a version. No other changes have been made in the PR.

This is danger.yml

name: danger
on: [pull_request]

jobs:
  build:
    name: danger
    runs-on: ubuntu-latest
    if: ${{ github.actor != 'dependabot[bot]' }}
    steps:
      - uses: actions/checkout@v1
      - uses: danger/danger-js@9.1.6
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  skip_build:
    name: danger [dependabot]
    runs-on: ubuntu-latest
    if: ${{ github.actor == 'dependabot[bot]' }}
    steps:
      - run: 'echo "No build required"'
software version
danger.js 10.6.4
node 14
npm 8.3.1
Operating System MacOs Monterey 12.1

Additional context There's a mismatch between the local danger version 10.6.4 and the one used in the github workflow 9.1.6 do you think that might be an issue?

orta commented 2 years ago

Yeah, we've been debating removing that for a year or two, https://github.com/danger/danger-js/issues/1038 and I guess this is a good incentive for us to just call the call - I'd recommend using npx

ruxiang05 commented 2 years ago

I've tried using npx danger ci, here's the yml

name: danger
on: [pull_request]

jobs:
  build:
    name: danger
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Use Node.js 14.x
        uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - name: Danger
        run: npx danger ci
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

It's coming back with a syntax error although npx danger pr and vscode are not signalling any problem. Screenshot 2022-02-01 at 18 20 11

orta commented 2 years ago

Yeah, it's trying to run a TS file inside a JS engine, try https://www.npmjs.com/package/danger-ts instead to get typescript added to your npx run