|
| 1 | +# Running CI on a Fork |
| 2 | + |
| 3 | +This document explains how to run the OpenSearch-Dashboards GitHub Actions workflows on your fork, so you can verify tests pass before opening PRs to the upstream repository. |
| 4 | + |
| 5 | +## Enabling GitHub Actions on Your Fork |
| 6 | + |
| 7 | +1. **Go to your fork** on GitHub (e.g., `your-org/OpenSearch-Dashboards`). |
| 8 | + |
| 9 | +2. **Enable Actions** (if not already enabled): |
| 10 | + - Settings → Actions → General |
| 11 | + - Under "Actions permissions", select **"Allow all actions and reusable workflows"** |
| 12 | + - Save |
| 13 | + |
| 14 | +3. **Workflows run automatically** when you: |
| 15 | + - Push to any branch |
| 16 | + - Open a pull request (to any branch, including your fork's `main`) |
| 17 | + |
| 18 | +## Workflows That Run on Forks |
| 19 | + |
| 20 | +The following workflows run on forks without any additional configuration: |
| 21 | + |
| 22 | +| Workflow | Trigger | Purpose | |
| 23 | +|----------|----------|---------| |
| 24 | +| **build_and_test_workflow** | Push to main/version branches, all PRs | Unit tests, lint, typecheck, functional tests, build artifacts | |
| 25 | +| **cypress_workflow** | All PRs | Cypress E2E tests | |
| 26 | +| **osart_ci** | PRs touching `plugins/osart/**` | OSART plugin Cypress tests | |
| 27 | +| **dependency_review** | All PRs | Dependency vulnerability scan | |
| 28 | +| **links_checker** | Push/PR to main | Link validation | |
| 29 | +| **lighthouse_testing** | PRs to main | Performance testing | |
| 30 | +| **add-untriaged** | Issue opened | Label management | |
| 31 | +| **delete_backport_branch** | Backport PR closed | Cleanup | |
| 32 | +| **github-workflow-badger** | PR opened | Contributor badges | |
| 33 | + |
| 34 | +## Workflows That Skip on Forks |
| 35 | + |
| 36 | +These workflows require upstream-only secrets or infrastructure. They automatically skip when `github.repository != 'opensearch-project/OpenSearch-Dashboards'`: |
| 37 | + |
| 38 | +| Workflow | Reason | |
| 39 | +|----------|--------| |
| 40 | +| **pr_review** | Requires BEDROCK_ACCESS_ROLE (AI code review) | |
| 41 | +| **version-increment** | Upstream release automation | |
| 42 | +| **cypress_workflow_with_s3** | Requires S3 connection secrets | |
| 43 | +| **opensearch_changelog_workflow** | Requires changelog bridge API secrets | |
| 44 | +| **backport** | Requires opensearch-trigger-bot GitHub App | |
| 45 | +| **create_doc_issue** | Requires opensearch-trigger-bot GitHub App | |
| 46 | + |
| 47 | +## Optional: Code Coverage Upload |
| 48 | + |
| 49 | +The build workflow uploads coverage to Codecov when `CODECOV_TOKEN` is set. To enable: |
| 50 | + |
| 51 | +1. Sign up at [codecov.io](https://codecov.io) and add your fork |
| 52 | +2. Copy your repo token |
| 53 | +3. In your fork: Settings → Secrets and variables → Actions |
| 54 | +4. Add secret: `CODECOV_TOKEN` = your token |
| 55 | + |
| 56 | +If the secret is not set, the upload step is skipped and the build still passes. |
| 57 | + |
| 58 | +## Testing Before Upstream PR |
| 59 | + |
| 60 | +1. Push your branch to your fork |
| 61 | +2. Open a PR from your branch → your fork's `main` (or create a `test` branch) |
| 62 | +3. GitHub Actions will run the same build_and_test_workflow, cypress_workflow, etc. that upstream uses |
| 63 | +4. Fix any failures before opening a PR to `opensearch-project/OpenSearch-Dashboards` |
| 64 | + |
| 65 | +This avoids waiting for upstream maintainer approval of first-time contributor workflows, since your fork's workflows run immediately. |
0 commit comments