Skip to content

Read gh pr merge's Boolean -m Before Skipping a Value in the Write Guard's Target Check #3004

Closed

Description

@ptr727

Context

Found by the local review of the lane closing #2957, reading _gh_write_targets. Develop's guard shares it. It was found by reading the code, and the classify call below is the probe that would show it.

A Boolean -m on gh pr merge Hides the Repo Flag After It

_gh_write_targets skips the value of each option in _GH_CREATE_TEXT_VALUE_FLAGS, which lists -m as taking a value. On gh pr merge, -m is the boolean --merge. So in gh pr merge 5 -m -R stranger/example, the -R is skipped as -m's value, no target is read, and a merge into a repository under another owner is allowed.

Probe: classify("gh pr merge 5 -m -R stranger/example", origin=("example", "repo"), environ={}).

Possible Direction

Give each gh subcommand its own value-option table, or read pr merge with one that matches gh's flags. The lane closing #2957 added _GH_MERGE_VALUE_FLAGS for the --admin check, which is a starting point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions