Mergifyio / mergify

Mergify Community Issue Tracker
https://mergify.com
Apache License 2.0
318 stars 91 forks source link

Can’t use OR-condition on PR #5047

Closed ulysses4ever closed 1 year ago

ulysses4ever commented 1 year ago

Expected Behavior

here’s an (I hope, standalone) excerpt of our proposed config:

pull_request_rules:
  - actions:
      label:
        add:
          - merge delay passed
    name: Wait for 2 days before validating merge
    conditions:
      - updated-at<2 days ago
      - or
        - label=merge me
        - label=squash+merge me

I expect it to apply a label under the said condition.

Actual Behavior

Mergify complains:

Invalid condition 'or - label=merge me - label=squash+merge me'. Invalid attribute @ pull_request_rules → item 0 → conditions → item 1

Worth noting: it worked when the condition had no ORs (instead of the OR it just had “label=merge me”). It’s just we want the OR.

Specifications

DouglasBlackwood commented 1 year ago

Hi!

I think the or condition is missing a : character. Otherwise, it might be wrongly interpreted. Can you test something like this?

pull_request_rules:
  - actions:
      label:
        add:
          - merge delay passed
    name: Wait for 2 days before validating merge
    conditions:
      - updated-at<2 days ago
      - or:
        - label=merge me
        - label=squash+merge me

More examples here.

ulysses4ever commented 1 year ago

Oh, silly me! Thank you so much for the prompt help!