Skip to content

Repositories exclusion not working for empty repos #1014

Description

@edro15

Problem Description

I have this deployment-settings.yml:

restrictedRepos:
  exclude:
    - repo-A
    - repo-B
    - myrepo

Settings are NOT enforced on myrepo as expected, but such enforcement is triggered on both repo-A and repo-B. Such enforcement fails cause repo-A and repo-B are still empty and an error is thrown.

What is actually happening

The settings enforcement is triggered even if repository is listed among the excluded ones.

What is the expected behavior

That the excluded repositories are actually excluded by any kind of attempt of settings enforcement.

Error output, if available

Error applying branch protection.

 {
  "name":"HttpError",
  "status":404,
  "data": {
    "message":"Branch not found",
    "documentation_url":"https://docs.github.com/rest/branches/branch-protection#update-branch-protection",
    "status":"404"
  }
}

Such error is totally fair cause the repos are effectively empty. But why does it matter since the repo should be excluded? It seems such exclusion is ignored.

Context

Are you using the hosted instance of probot/settings or running your own?

My own, deployed via Github action as per documentation

If running your own instance, are you using it with github.com or GitHub Enterprise?

github.com

Version of probot/settings

probot/13.4.4

Version of GitHub Enterprise

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions