Skip to content

graphQL RuleSource node / sourceID global id error #77974

Discussion options

You must be logged in to vote

with help from a post by @jschnapper I figured out my call. For starters, I retrieved the repo's node id.
Since my repo is part of an org, my call used the Org Name.

query getRepoID {
  repository(owner: "OrgName-or-username", name: "repo-name-here") {
    id
  }
}

returned:

{
    "data": {
        "repository": {
            "id": "R_********"
        }
    }
}

The the call:

mutation {
  createRepositoryRuleset(input: 
    {
      sourceId: "<<repo_node_id_here>>" # must use repo node_id
      name: "Restrict Honey Branch Usage" # your ruleset name
      enforcement: ACTIVE
      target: BRANCH
      conditions: {
        refName: {
          include: ["refs/heads/*honey*"] # keep refs…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rfossicav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API and Webhooks Discussions and conversations related to APIs or Webhooks Question
1 participant