linear-b / gitstream

/:\ gitStream - Workflow automation for your git repo. Use YAML to auto-assign reviewers, auto-merge PRs, automatic PR labeler, and more.
https://gitstream.cm
Apache License 2.0
261 stars 30 forks source link

`pr.reviewers` always returns empty list when configured in cm repo #516

Closed bartkuzio closed 4 months ago

bartkuzio commented 4 months ago

Issue description

I have the following automation in my gitstream.cm file in cm repo:

  label_missing_reviewers:
    if:
      - {{ pr.reviewers | length < 2 }}
    run:
      - action: add-label@v1
        args:
          label: "⚠️ missing reviewers"
          color: "#008672"
      - action: add-comment@v1
        args:
          comment: "Reviewers count: {{ pr.reviewers | length }}"

When running this automation on any PR it always adds the label and the comment says Reviewers count: 0 no matter how many reviewers are added. The same automation added on a specific repository works fine, so the issue is with the organization wide automation.

I cannot show the PR as it's in a private repo.

Expected behavior

pr.reviewers | length should return the count of reviewers of the PR.

Screenshots

image

image

vim-zz commented 4 months ago

@bartkuzio thank you for reporting! there was a regression that caused this context variable to be always empty in GitHub. It was fixed.