Skip to content

Recreating the example from README throws the error: "Error importing ruleset: The ruleset you are importing contains an invalid actor" #39

@barremian

Description

@barremian

Describe the bug

Importing the branch-rulesets/PRs and commits.json rulesets throws an error.

To Reproduce

  1. Clone this repo.
  2. Open a repo with admin rights.
  3. Go to Settings -> Rules -> Rulesets.
  4. Import the ruleset branch-rulesets/PRs and commits.json as shown in the video example from this repo.

Expected behavior

The ruleset gets imported as shown in the video without throwing any errors.

Actual behavior

The following error is thrown:

Error importing ruleset: The ruleset you are importing contains an invalid actor

Screenshots/Video

Image
Screen.Recording.2025-12-25.at.2.13.42.PM.mov

Environment

  • OS: macOS
  • Browser: Chrome

Additional Context

Possible source of the error:

  • My Github account is a personal account.
  • According to the Github Docs (see "Properties of bypass_actors -> actor_id"), the "actor_type": "OrganizationAdmin" used in the PRs and commits.json#L44 file is not applicable for personal repositories.
  • FWIW I was able to import the rule after deleting the bypass_actors property from the PRs and commits.json file.
  • Manually adding the bypass actors and exporting the ruleset revealed the following bypass_actors block where the actor IDs 2, 4, 5 correspond to maintain, write, and admin respectively as discussed here.
    "bypass_actors": [
      {
        "actor_id": 2,
        "actor_type": "RepositoryRole",
        "bypass_mode": "always"
      },
      {
        "actor_id": 4,
        "actor_type": "RepositoryRole",
        "bypass_mode": "always"
      },
      {
        "actor_id": 5,
        "actor_type": "RepositoryRole",
        "bypass_mode": "always"
      }
    ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions