Skip to content

Commit 2612f5a

Browse files
committed
Update CI workflows to minimally work on our fork; include instructions
1 parent dbe62ce commit 2612f5a

6 files changed

Lines changed: 72 additions & 2 deletions

File tree

.github/FORK_CI_SETUP.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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.

.github/workflows/backport.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ jobs:
1414
name: Backport
1515
# Only react to merged PRs for security reasons.
1616
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
17+
# Only run on upstream repo (requires opensearch-trigger-bot GitHub App).
1718
if: >
18-
github.event.pull_request.merged
19+
github.repository == 'opensearch-project/OpenSearch-Dashboards'
20+
&& github.event.pull_request.merged
1921
&& (
2022
github.event.action == 'closed'
2123
|| (

.github/workflows/build_and_test_workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108

109109
- name: Upload Code Coverage
110110
id: upload-code-coverage
111+
if: secrets.CODECOV_TOKEN != ''
111112
uses: codecov/codecov-action@v4
112113
with:
113114
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/create_doc_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88

99
jobs:
1010
create-issue:
11-
if: ${{ github.event.label.name == 'needs-documentation' }}
11+
if: ${{ github.repository == 'opensearch-project/OpenSearch-Dashboards' && github.event.label.name == 'needs-documentation' }}
1212
runs-on: ubuntu-latest
1313
name: Create Documentation Issue
1414
steps:

.github/workflows/cypress_workflow_with_s3.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ env:
3838

3939
jobs:
4040
cypress-tests:
41+
if: github.repository == 'opensearch-project/OpenSearch-Dashboards'
4142
runs-on: ubuntu-latest
4243
container:
4344
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2

.github/workflows/opensearch_changelog_workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111

1212
jobs:
1313
update-changelog:
14+
if: github.repository == 'opensearch-project/OpenSearch-Dashboards'
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Check out repository

0 commit comments

Comments
 (0)