# 1. Create repositories

In order to set up sfops in your GitHub organization, you need to set up the following repositories:

## Required Repositories

These repositories are essential for a functioning sfops setup:

| Repository          | Description                                                                                                                               | Comments                                                                                           |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `sfops`             | Repository that contains the source code for sfops                                                                                        |                                                                                                    |
| `sfops-gh-actions`  | The 'production' repository that will contain the workflows and actions that is built from the sfops directory                            | Your Salesforce projects will be consuming the actions and reusable workflows from this repository |
| `sfops-dev-central` | The 'production' dev central repository that will be used to build the GitHub pages static website which will house the sfops dev central |                                                                                                    |
| `<project-repo>`    | The mono repository that will contain your Salesforce config/code                                                                         |                                                                                                    |

## Optional Repositories

These repositories are only needed for specific scenarios:

| Repository               | Description                                                                                                                         | Comments                                                                                                                                                 |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sfp-pro`                | Repository that contains the source code for sfp pro, which has additional features that are required for sfops                     | Only if you intend to maintain your own fork of sfp-pro                                                                                                  |
| `sfops-gh-actions-test`  | The 'test' repository that will contain the workflows and actions that is built from the sfops directory                            | Required if you want to make changes to the default actions and workflow and test it before rolling out to the production 'sfops-gh-actions' repository  |
| `sfops-dev-central-test` | The 'test' dev central repository that will be used to build the GitHub pages static website which will house the sfops dev central | Required if you want to make changes to the default actions and workflow and test it before rolling out to the production 'sfops-dev-central' repository |
| `<project-test-repo>`    | The mono 'test' repository that will contain your Salesforce config/code                                                            | Required if you want to test the workflows/actions before rolling out to project repository                                                              |

## Configure Repository Access for Reusable Workflows

{% hint style="danger" %}
**Critical Step**: After creating the repositories, you MUST configure the sfops-gh-actions repository to allow other repositories to use its reusable workflows. Without this, your project repositories will fail with "workflow was not found" errors.
{% endhint %}

### Configure sfops-gh-actions Repository

1. Navigate to your `sfops-gh-actions` repository
2. Go to **Settings** → **Actions** → **General**
3. In the **"Workflow permissions"** section:
   * Select **"Read and write permissions"**
     * This allows workflows to have read and write permissions in the repository for all scopes
     * Required for workflows to create tags, push changes, and publish artifacts
4. Scroll down to the **"Access"** section at the bottom
5. Select one of these options based on your security requirements:
   * **Accessible from repositories in the '\[your-org]' organization** (Recommended)
     * Allows any repository in your organization to use the workflows
     * Access is allowed only from private or internal repositories
   * **Accessible from repositories in the '\[your-enterprise]' enterprise**
     * If you're using GitHub Enterprise and want broader access
6. Click **Save** to apply all settings

### Configure sfops-gh-actions-test Repository (if using)

If you created a test repository, repeat the same steps:

1. Navigate to your `sfops-gh-actions-test` repository
2. Go to **Settings** → **Actions** → **General**
3. In the **"Access"** section, select the same option as above
4. Click **Save**

{% hint style="info" %}
**Note**: These settings only need to be configured once when setting up the repositories. The workflows will be accessible to all repositories in your organization after this configuration.
{% endhint %}

## Configure GitHub Pages for Dev Central Dashboard

The sfops-dev-central repository hosts the dashboard as a GitHub Pages site. You must enable Pages after creating the repository:

### Enable GitHub Pages

1. Navigate to your `sfops-dev-central` repository
2. Go to **Settings** → **Pages** (or directly: `https://github.com/YOUR_ORG/sfops-dev-central/settings/pages`)
3. Under **"Build and deployment"** → **"Source"**, select:
   * **GitHub Actions** (this is required for the dashboard workflows to deploy)
4. Click **Save**

{% hint style="warning" %}
**Important**: GitHub Pages must be enabled BEFORE running any dashboard update workflows. If not enabled, workflows will fail with "Get Pages site failed" errors.
{% endhint %}

### Enable GitHub Pages for Test Repository (if using)

If you created a test dev-central repository, repeat the same steps:

1. Navigate to your `sfops-dev-central-test` repository
2. Go to **Settings** → **Pages**
3. Under **"Source"**, select **GitHub Actions**
4. Click **Save**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfops/self-managed-instances/setting-up/1.-create-repositories.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
