danger / danger/peril

Guidance needed over repos and rules covering same event

Open
#344 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
460
Forks
55
PR merge metrics
No merged PRs in 30d

Description

Thanks @orta for Danger and Peril. We've been using Danger for a few months and love it and are just getting started with Peril.

There is something we don't understand in Peril we could use your help with please, we've probably misunderstood something.

### Aim

For a given event (in this case when a label is added to a PR) handle the event at the repo level, and also at the org level.

### Example Settings

We have tried these two approaches which both exhibit the same behaviour. The .js files each contain a call to `message` which says `"Org"` or `"Repo"` respectively.

```json
{
"repos": {
"org/some-project": {
"pull_request.labeled": [
"org/peril@scripts/org/pull_request.labeled.js",
"org/peril@scripts/some-project/pull_request.labeled.js"
]
}
}
}
```

```json
{
"rules": {
"pull_request.labeled": "org/peril@scripts/org/pull_request.labeled.js"
},
"repos" : {
"org/some-project": {
"pull_request.labeled": "org/peril@scripts/some-project/pull_request.labeled.js"
}
}
}
```

### Expected Behaviour

`"Org"` message is output, followed by `"Repo"` message.

### Actual Behaviour

`"Org"` message is output twice, or if the array was reversed in the first example, `"Repo"` was output twice.

Please could you advise on whether we're going about this the wrong way or if this is possibly an issue?

Thanks a lot.

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.