# Public fork

One method you can use to leverage Panther-managed detectionswithin your [CI/CD workflow](https://docs.panther.com/~/changes/15ann7vKLltCCAGHtdQr/panther-developer-workflows/ci-cd) is to create a public fork of [panther-analysis](https://github.com/panther-labs/panther-analysis).

For organizations who want to share their detection content publicly or want to bring content upstream into [panther-labs/panther-analysis](https://github.com/panther-labs/panther-analysis), a public fork is the right choice.&#x20;

For information on creating a private clone of the repo, see [Private cloned repo](https://docs.panther.com/~/changes/15ann7vKLltCCAGHtdQr/panther-developer-workflows/ci-cd/detections-repo/private-cloned-repo).

## Configuring a public fork of panther-analysis

Follow the below instructions to create a public fork of panther-analysis. For reference, see [GitHub's complete instructions on forking a repo here](https://docs.github.com/en/get-started/quickstart/fork-a-repo).

1. Log in to GitHub and navigate to [panther-labs/panther-analysis](https://github.com/panther-labs/panther-analysis). \
   ![The image shows the upper right corner of the panther-analysis repo in Github. There is an arrow pointing to the "Fork" button.](https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2FdJYiTHJ9fgvDNW0ZV419%2Fgithub-fork.png?alt=media\&token=1fbe09c3-7ad2-40a7-bb38-8c7c1a279b6b)
2. In the upper right corner of the repository’s main page click **Fork**.&#x20;
   * This will create a fork of the `panther-analysis` repo in your organization. This will serve as your working copy of `panther-analysis`, and any changes required by your organization can be made here and will undergo any configured CI checks that you define.&#x20;
3. (Optional) Unzip any of your custom detections into the same directory as your forked version of `panther-analysis`.&#x20;

## Keeping in Sync with Upstream

We recommend that you leverage our included [sync-panther-analysis-from-upstream](https://github.com/panther-labs/panther-analysis/blob/master/.github/workflows/sync-from-upstream.yml) GitHub Action to stay in sync with upstream:

1. Log in to your GitHub account and navigate to your repository.
2. In the horizontal menu bar, click **Actions**, then click the `sync-panther-analysis-from-upstream` action.
3. Click **Run Workflow > Run workflow.**
   * Once the action is complete, you will see a green circle next to the workflow run. If there are changes, you should see a new open pull request authored by GitHub Actions. If there are no changes, you should see a message similar to “Local repo already synced to latest release.”
   * Note: The `sync-panther-analysis-from-upstream` action is configured to run on a cron schedule every Tuesday at 15:00Z. You can modify this schedule on line 6 of **.github/workflows/sync-from-upstream.yml**.
4. Merge the pull request into your primary branch, as you would with a normal pull request.&#x20;

Your repository will reflect the merge as your latest change, and you will be able to view both your private repo and panther-analysis git histories.

If you run into issues with merge conflicts or see an error that states "all jobs have failed," please see this troubleshooting article: [How do I resolve merge conflicts and failed syncs when using the GitHub Action sync-panther-analysis-from-upstream?](https://help.panther.com/Panther_Developer_Workflows/panther-analysis/How_do_I_resolve_merge_conflicts_and_failed_syncs_when_using_the_GitHub_Action_sync-panther-analysis-from-upstream%3F)

### Manual updates

Alternatively, you can manually update the fork. Please see [GitHub's documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to learn more about the process of manually updating the fork from its source, in this case panther-labs/panther-analysis.&#x20;

It is recommended to always using the "compare" option detailed in these documents to ensure you are pulling in changes that make sense for your organization.  This will display the updates as a Pull Request, and changes and comments can be made.

## Next Steps

After you fork the repo, you can integrate Panther detections into your CI/CD workflow. Panther offers documentation for [CircleCI](https://docs.panther.com/~/changes/15ann7vKLltCCAGHtdQr/panther-developer-workflows/ci-cd/deployment-workflows/circle-ci) and [GitHub Actions](https://docs.panther.com/~/changes/15ann7vKLltCCAGHtdQr/panther-developer-workflows/ci-cd/deployment-workflows/github-actions).

### GitHub Actions

You can create your own GitHub Action to upload detection content to your Panther instance, and it can be configured to run automatically on each merged pull request to your repo.&#x20;

See [Managing Content via GitHub Actions](https://docs.panther.com/~/changes/15ann7vKLltCCAGHtdQr/panther-developer-workflows/ci-cd/deployment-workflows/github-actions) for more information.

### Customer contributed content&#x20;

Customers are encouraged to contribute content back upstream to panther-analysis. If you’d like to do so, you can create a Pull Request against the panther-analysis repository. One of our detection engineers will happily review and merge it!
