danger / Peril

Adding support for PR push events

Adding support for PR push events

danger / Peril · April 13, 2018 at 4:04pm(Edited 5 months ago)
I'm running into a problem with Danger: it doesn't run for PRs from forks because we don't allow our secrets to be used for obvious security reasons.
I wanted to move us entirely over to Peril (which doesn't have this problem since both the logs and the code running are separated from the repo), but the issue was that it wouldn't run for PR updates. Looking at the GitHub event docs, it seems like what I want is the push event, but specific to a PR. If one could listen to pull_request.push one could basically entirely replace Danger with Peril.
Is there any chance support for that could be added to Peril?

April 25, 2018 at 4:27pm

That's already supported, yeah! Any

  • reply
  • like

Hah, you can run code directly on just one action in the settings definition

  • reply
  • like
{
"settings": {
"modules": ["danger-plugin-spellcheck", "danger-plugin-yarn", "@slack/client", "semver-sort"]
},
"rules": {
"create": "danger/peril-settings@org/new_tag.ts",
"pull_request.closed": "danger/peril-settings@org/aeryn.ts",
"pull_request": ["danger/peril-settings@org/debug.ts", "danger/peril-settings@org/changelog.ts"]
}
}
  • reply
  • like

I got that

  • reply
  • like

But I'm looking for basically pull_request.push which doesn't exist as far as I could tell?

  • reply
  • like

I've used rules perfectly fine, I just couldn't find a reference to pull_request.push in the gitHub docs so I assumed it wouldn't work?

  • reply
  • like

That's basically what I need to replace Danger with Peril

  • reply
  • like

synchronized is what you're thinking of

  • reply
  • like

that's when a new commit is added

  • reply
  • like

Oh shit for real? pull_request.synchronized ?

  • reply
  • like

Damn I thought I had to listen to push events manually and filter them out

  • reply
  • like

Perfect, I'll try that—thank you!

  • reply
  • like

Yep, about 95% certain

  • reply
  • like

Yeah, that's what I see in my events when I push to a PR, I can update the docs

like-fill
1
  • reply
  • like

You're the best

  • reply
  • like

Thank you, that makes so much sense!

  • reply
  • like

it might need to be on both opened and synchronize to get the exact same behavior

like-fill
1
  • reply
  • like

That's fine, it's idempotent anyway so if it runs twice it won't hurt anybody

  • reply
  • like

Is it synchronize or synchronized?

  • reply
  • like

docs imply synchronize

  • reply
  • like

trying to get an event I can verify, since I started getting statuses it's so much noise now

  • reply
  • like

That'd be very inconsistent given it's opened and edited , but I'll just add bnoth

  • reply
  • like

Can't hurt to have both either

  • reply
  • like
Your message here...

*bold*_italic_`code````codeblock```