{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/github/v1/render-taskcluster-yml-input.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": false,
  "definitions": {
    "overrides": {
      "additionalProperties": true,
      "description": "Additional data to be mixed to the mocked event object.\nThis can be used to set some specific properties of the event or override the existing ones.\nFor example:\n  \"ref\": \"refs/heads/main\"\n  \"before\": \"000\"\n  \"after\": \"111\"\nTo make sure which properties are available for each event type,\nplease refer to the github [documentation](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads)\n",
      "title": "Custom event payload",
      "type": "object"
    }
  },
  "description": "Render .taskcluster.yml for one of the supported events.\n\nRead more about the `.taskcluster.yml` file format in\n[documentation](https://docs.taskcluster.net/docs/reference/integrations/github/taskcluster-yml-v1)\n",
  "properties": {
    "body": {
      "description": "The contents of the .taskcluster.yml file.",
      "title": "Taskcluster.yml contents",
      "type": "string"
    },
    "fakeEvent": {
      "description": "Emulate one of the github events with mocked payload.\nSome of the events have sub-actions, that can be specified.\nEvent type names follow the `tasks_for` naming convention.\n",
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "Github sends `push` event for commits and for tags.\nTo distinguish between those two, the `ref` property is used.\nIf you want to mock a tag push, please specify `ref` property in the overrides:\n\"ref\": \"refs/tags/v1.0.0\"\n",
          "properties": {
            "overrides": {
              "$ref": "#/definitions/overrides"
            },
            "type": {
              "enum": [
                "github-push"
              ],
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "title": "Push events",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": ".taskcluster.yml supports `github-pull-request` and `github-pull-request-untrusted` events.\nThe difference is that `github-pull-request-untrusted` will use different set of scopes.\nSee [RFC 175](https://github.com/taskcluster/taskcluster-rfcs/blob/main/rfcs/0175-restricted-pull-requests.md)\n",
          "properties": {
            "action": {
              "enum": [
                "opened",
                "synchronize",
                "reopened",
                "assigned",
                "auto_merge_disabled",
                "auto_merge_enabled",
                "closed",
                "converted_to_draft",
                "dequeued",
                "edited",
                "enqueued",
                "labeled",
                "ready_for_review",
                "review_requested",
                "review_request_removed",
                "unassigned",
                "unlabeled"
              ],
              "title": "Pull Request action"
            },
            "overrides": {
              "$ref": "#/definitions/overrides"
            },
            "type": {
              "enum": [
                "github-pull-request",
                "github-pull-request-untrusted"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "action"
          ],
          "title": "Pull Request events",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "action": {
              "enum": [
                "published",
                "unpublished",
                "created",
                "edited",
                "deleted",
                "prereleased",
                "released"
              ],
              "title": "Release action"
            },
            "overrides": {
              "$ref": "#/definitions/overrides"
            },
            "type": {
              "enum": [
                "github-release"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "action"
          ],
          "title": "Release events",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "action": {
              "enum": [
                "created",
                "edited"
              ],
              "title": "Issue Comment action"
            },
            "overrides": {
              "$ref": "#/definitions/overrides"
            },
            "type": {
              "enum": [
                "github-issue-comment"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "action"
          ],
          "title": "Issue Comment events",
          "type": "object"
        }
      ]
    },
    "organization": {
      "pattern": "^[-a-zA-Z0-9]{1,39}$",
      "title": "The organization that owns the repository.\nThis value together with the repository name will be used in mocked event payload.\n",
      "type": "string"
    },
    "repository": {
      "pattern": "^[-a-zA-Z0-9_.]{1,100}$",
      "title": "The repository name.",
      "type": "string"
    }
  },
  "required": [
    "body",
    "fakeEvent"
  ],
  "title": "Render .taskcluster.yml input",
  "type": "object"
}