Skip to content

Commit 0a7cd1d

Browse files
bryan-coxclaude
andcommitted
docs: update GitHub Actions page with slash-command workflows
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7eea4bd commit 0a7cd1d

1 file changed

Lines changed: 55 additions & 30 deletions

File tree

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# GitHub Actions Workflows
1+
# 🔄 GitHub Actions Workflows
22

33
HyperShift uses GitHub Actions for lightweight CI checks that run on every pull request. These workflows complement the heavier Prow-based e2e tests by providing fast feedback on code quality, formatting, and documentation.
44

5-
## Reusable Workflow Architecture
5+
## 🏗️ Reusable Workflow Architecture
66

77
All GHA workflows follow a **caller + reusable** pattern:
88

@@ -23,15 +23,15 @@ flowchart LR
2323

2424
This pattern provides:
2525

26-
- **Consistency** — all PR and push workflows share the same job definitions.
27-
- **Maintainability** — job logic is defined once in the reusable workflow and updated in a single place.
28-
- **Security** — callers pin reusable workflows to `@main`, reducing the risk of PRs altering reusable job logic. Caller workflows are protected by branch protection rules and CODEOWNERS.
26+
- **Consistency** — all PR and push workflows share the same job definitions.
27+
- 🔧 **Maintainability** — job logic is defined once in the reusable workflow and updated in a single place.
28+
- 🔒 **Security** — callers pin reusable workflows to `@main`, reducing the risk of PRs altering reusable job logic. Caller workflows are protected by branch protection rules and CODEOWNERS.
2929

30-
## Workflows
30+
## 📋 Workflows
3131

3232
All workflows run on self-hosted ARC runners and target the `main` and `release-4.22` branches.
3333

34-
### Code Quality
34+
### 🧹 Code Quality
3535

3636
| Caller | Reusable | Purpose |
3737
|--------|----------|---------|
@@ -40,32 +40,58 @@ All workflows run on self-hosted ARC runners and target the `main` and `release-
4040
| `lint.yaml` | `lint-reusable.yaml` | Go linting via `golangci-lint` |
4141
| `verify.yaml` | `verify-reusable.yaml` | Full verification (`make verify`) |
4242

43-
### Testing
43+
### 🧪 Testing
4444

4545
| Caller | Reusable | Purpose |
4646
|--------|----------|---------|
4747
| `test.yaml` | `test-reusable.yaml` | Unit tests with race detection and Codecov upload |
4848
| `envtest-ocp.yaml` | `envtest-ocp-reusable.yaml` | CRD validation tests against OpenShift k8s versions |
4949
| `envtest-kube.yaml` | `envtest-kube-reusable.yaml` | CRD validation tests against vanilla k8s versions |
5050

51-
### Documentation
51+
### 📖 Documentation
5252

5353
| Caller | Reusable | Purpose |
5454
|--------|----------|---------|
5555
| `docs-build.yaml` | `docs-build-reusable.yaml` | Build MkDocs site in strict mode |
5656

57-
The `docs-deploy.yaml` workflow is not a reusable workflow pair — it triggers via `workflow_run` after the Docs Build completes to deploy the preview. See [Documentation Preview](docs-preview.md) for details.
57+
!!! info
58+
The `docs-deploy.yaml` workflow is not a reusable workflow pair — it triggers via `workflow_run` after the Docs Build completes to deploy the preview. See [Documentation Preview](docs-preview.md) for details.
5859

59-
### Other
60+
### 🤖 PR Slash Commands
61+
62+
These workflows are triggered by posting a **slash command** as a comment on a pull request. They are powered by [Claude Code](https://docs.anthropic.com/en/docs/claude-code) via the shared `reusable-claude-on-pr.yaml` workflow, which handles checking out the PR branch, authenticating to GCP (for Vertex AI), and running Claude with the appropriate prompt.
63+
64+
!!! warning "Permissions"
65+
Only organization **members**, **owners**, and **collaborators** can trigger these commands. Comments from external contributors are ignored.
66+
67+
| Command | Workflow | What it does |
68+
|---------|----------|--------------|
69+
| `/address-review-comments` | `address-review-comments.yaml` | Reads open review comments on the PR and pushes commits to address them |
70+
| `/rebase` | `rebase.yaml` | Rebases the PR branch onto the latest `main` and force-pushes |
71+
| `/restructure-commits` | `restructure-commits.yaml` | Reorganizes the PR's commits into logical units with conventional commit messages |
72+
73+
**How it works:**
74+
75+
1. Post the slash command (e.g., `/rebase`) as a comment on a PR.
76+
2. The workflow posts a 🔗 reply comment linking to the Actions run so you can follow progress.
77+
3. Claude checks out the PR branch, performs the requested operation, and pushes the result.
78+
79+
!!! tip
80+
Each command uses concurrency groups scoped to the PR number — re-triggering a command automatically cancels the previous run for that PR.
81+
82+
### 🔧 Other
6083

6184
| Caller | Reusable | Purpose |
6285
|--------|----------|---------|
6386
| `cpo-container-sync.yaml` | `cpo-container-sync-reusable.yaml` | Validate CPO container image references are in sync |
6487
| `dependabot-commit-fix.yaml` | `dependabot-commit-fix-reusable.yaml` | Rewrite dependabot commit messages to pass gitlint |
88+
| `gocacheprog-test.yaml` | `gocacheprog-test-reusable.yaml` | Tests for the `contrib/ci/gocacheprog` build cache tool (path-filtered) |
89+
| `validate-cpo-overrides.yaml` || Validate CPO override images exist and are pullable |
6590

66-
The `sync-community-fork.yaml` workflow runs on push to `main` only (not on PRs) and does not use the reusable pattern. See [Sync Community Fork](sync-community-fork.md) for details.
91+
!!! note
92+
The `sync-community-fork.yaml` workflow runs on push to `main` only (not on PRs) and does not use the reusable pattern. See [Sync Community Fork](sync-community-fork.md) for details.
6793

68-
## Adding a New Workflow
94+
## Adding a New Workflow
6995

7096
To add a new GHA workflow:
7197

@@ -74,20 +100,19 @@ To add a new GHA workflow:
74100
3. Add branch filters for `main` and any active release branches.
75101
4. Use `arc-runner-set` as the runner.
76102

77-
Example caller:
78-
79-
```yaml
80-
name: My Check
81-
82-
on:
83-
pull_request:
84-
branches:
85-
- main
86-
- release-4.22
87-
88-
jobs:
89-
my-check:
90-
uses: openshift/hypershift/.github/workflows/my-check-reusable.yaml@main
91-
permissions:
92-
contents: read
93-
```
103+
??? example "Example caller workflow"
104+
```yaml
105+
name: My Check
106+
107+
on:
108+
pull_request:
109+
branches:
110+
- main
111+
- release-4.22
112+
113+
jobs:
114+
my-check:
115+
uses: openshift/hypershift/.github/workflows/my-check-reusable.yaml@main
116+
permissions:
117+
contents: read
118+
```

0 commit comments

Comments
 (0)