Unverified Commit db8f50b4 authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

ci/github-script/merge: improve wording

parent 2d0a8791
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ These issues effectively list PRs the merge bot has interacted with.
To ensure security and a focused utility, the bot adheres to specific limitations:

- The PR targets `master`, `staging`, or `staging-next`.
- The PR only touches files located under `pkgs/by-name/*`.
- The PR only touches packages located under `pkgs/by-name/*`.
- The PR is authored by [@r-ryantm](https://nix-community.github.io/nixpkgs-update/r-ryantm/) or a [committer][@NixOS/nixpkgs-committers].
- The user attempting to merge is a member of [@NixOS/nixpkgs-maintainers].
- The user attempting to merge is a maintainer of all packages touched by the PR.
+6 −3
Original line number Diff line number Diff line
@@ -27,14 +27,16 @@ function runChecklist({
      'staging',
      'staging-next',
    ].includes(pull_request.base.ref),
    'PR touches only files in `pkgs/by-name/`.': allByName,
    'PR touches only packages in `pkgs/by-name/`.': allByName,
    'PR authored by r-ryantm or committer.':
      pull_request.user.login === 'r-ryantm' ||
      committers.has(pull_request.user.id),
  }

  if (user) {
    checklist[`${user.login} can use the merge bot.`] = userIsMaintainer
    checklist[
      `${user.login} is a member of [@NixOS/nixpkgs-maintainers](https://github.com/orgs/NixOS/teams/nixpkgs-maintainers).`
    ] = userIsMaintainer
    if (allByName) {
      // We can only determine the below, if all packages are in by-name, since
      // we can't reliably relate changed files to packages outside by-name.
@@ -249,8 +251,9 @@ async function handleMerge({

    const body = [
      `<!-- comment: ${comment.node_id} -->`,
      `@${comment.user.login} wants to merge this PR.`,
      '',
      'Requirements to merge this PR:',
      'Requirements to merge this PR with `@NixOS/nixpkgs-merge-bot merge`:',
      ...Object.entries(checklist).map(
        ([msg, res]) => `- :${res ? 'white_check_mark' : 'x'}: ${msg}`,
      ),