Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Danger via GitHub Actions Fails when Pull Request is from a Fork #625

Open
lcreid opened this issue Jan 10, 2022 · 6 comments
Open

Danger via GitHub Actions Fails when Pull Request is from a Fork #625

lcreid opened this issue Jan 10, 2022 · 6 comments

Comments

@lcreid
Copy link
Contributor

lcreid commented Jan 10, 2022

It appears that Danger can't find the commit from the pull request when the pull request is from a fork. This causes a lint failure for many pull requests. See the discussion at: danger/danger#1103.

If anyone has a solution, please submit a PR. Otherwise, this issue will serve to document the issue until we find something to replace Danger.

@donv
Copy link
Collaborator

donv commented Jan 15, 2022

Tried to fix this in #628 . Try to verify with #627 .

@donv
Copy link
Collaborator

donv commented Jan 15, 2022

So, the original problem was solved, but a new problem with dasnger has arisen. Seems like the access to create an issue comment is missing:

/opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/octokit-4.22.0/lib/octokit/response/raise_error.rb:14:in `on_complete': POST https://api.github.com/repos/bootstrap-ruby/bootstrap_form/issues/627/comments: 403 - Resource not accessible by integration // See: https://docs.github.com/rest/reference/issues#create-an-issue-comment (Octokit::Forbidden)

Anybody got an idea how to solve it?

@donv
Copy link
Collaborator

donv commented Jan 16, 2022

@lcreid (or other owner) We need an access token to enable merging fork PRs.

It must be added without GitHub noticing it: https://github.com/danger/danger/blob/43000055d824ca05a8c7ab63366d10e3d5c21529/.github/workflows/CI.yml#L28

@lcreid
Copy link
Contributor Author

lcreid commented Jan 16, 2022

I had hoped the original solution to get Danger working again didn't require the access token. I looked into this at one time, but didn't have time to investigate why it didn't work. And frankly I wasn't too happy about the security implications, or the long-term sustainability of the solution.

I'm totally open to a solution other than Danger, if anyone has experience with one.

@donv
Copy link
Collaborator

donv commented Jan 16, 2022

I agree that Danger seems britle on GH Actions. I'll do some research on alternatives. What we want is a check for Changelog entry and tests, mostly, right?

@lcreid
Copy link
Contributor Author

lcreid commented Jan 16, 2022

That's right. I believe Danger also checks to see what files are modified, and if not tests are modified/added, it asks that tests be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants