ruby / gem_rbs_collection

A collection of RBS for gems.
MIT License
255 stars 106 forks source link

Run comment on review workflow only when the PR is still opened #582

Closed pocke closed 3 months ago

pocke commented 3 months ago

Problem

Currently, this workflow comments to a PR if the PR has been already merged. Sometimes it's noisy. For example: https://github.com/ruby/gem_rbs_collection/pull/577#issuecomment-2144441234

Solution

Check the merge state before the comment to avoid unnecessary comments.

This patch uses gh pr view command instead of the event payload of GHA. We can easily imagine that a PR is merged while this workflow is running. Therefore it should check the PR state right before the comment.

github-actions[bot] commented 3 months ago

@pocke Thanks for your contribution!

Please follow the instructions below for each change. See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.


You changed non-gem files.

@pocke, please review and approve the changes.