danger / danger/swift

Returning exit code 0 on Github permissions error

Open
#605 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.1k
Forks
152
Avg merge
9h 54m
Merged PRs (30d)
2

Description

We were trying to configure Danger for our Github repo on CircleCI and we noticed it exits with code 0 even if token has wrong permissions. E.g. it prints:
```
Request failed [403]: https://example.com/repos/example/repo/pulls/1
Response: {
"message": "Resource not accessible by personal access token",
"documentation_url": "https://docs.github.com/rest/pulls/pulls#get-a-pull-request"
}
warning: The --path option is deprecated. Pass the path(s) to lint last to the swiftlint command.

Found only warnings, not failing the build.
Request failed [403]: https://example.com/repos/example/repo/pulls/1
Response: {
"message": "Resource not accessible by personal access token",
"documentation_url": "https://docs.github.com/rest/pulls/pulls#get-a-pull-request"
}
Feedback: https://example.com/repos/example/repo/pulls/1#issuecomment-123456
Could not add a commit status, the GitHub token for Danger does not have access rights.
If the build fails, then danger will use a failing exit code.
```

Is there a way how to force it to exit with 1 and to make whole pipeline failing?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.