swift: ERROR: Failed to parse JSON (issue/danger/github)

Hey

Trying to run danger-swift on Github’s actions, but the following error:

ERROR: Failed to parse JSON: keyNotFound(CodingKeys(stringValue: "issue", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "danger", intValue: nil), CodingKeys(stringValue: "github", intValue: nil)], debugDescription: "No value associated with key CodingKeys(stringValue: \"issue\", intValue: nil) (\"issue\").", underlyingError: nil))

ERROR: Dangerfile eval failed at Dangerfile.swift

Danger: ⅹ Failing the build, there is 1 fail.
## Failures
danger-swift` failed.

Any help would be greatly appreciated. Danger file is

import Danger

SwiftLint.lint()

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (10 by maintainers)

Most upvoted comments

The trigger should be pull_request, that was my first though when I asked for the yaml, I think the event.json doesn’t contain the pull request data if you don’t have a PR or an issue related event

also, are you on a GitHub enterprise account? I’ve never seen an issue being optional in a PR (in my non-enterprise world)

Yeah, that’s true - you need danger-swift local to run when it’s not a PR