Skip to content

NO-JIRA: Update GHA docs for reusable workflow pattern#8453

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
bryan-cox:update-gha-docs
May 8, 2026
Merged

NO-JIRA: Update GHA docs for reusable workflow pattern#8453
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
bryan-cox:update-gha-docs

Conversation

@bryan-cox
Copy link
Copy Markdown
Member

@bryan-cox bryan-cox commented May 6, 2026

Summary

  • Update hack/github-actions-runner/README.md to reflect the caller + reusable workflow pattern adopted across all GHA workflows
  • Add new MkDocs page documenting all GHA workflows and the reusable architecture
  • Update docs-preview page to reference the current docs-build + docs-deploy split

Test plan

  • Docs Build GHA workflow triggers on this PR
  • Docs Deploy Preview deploys successfully
  • Preview site renders the new GitHub Actions Workflows page correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added detailed GitHub Actions CI docs covering caller+reusable workflow patterns, workflow examples, and a new how-to page for docs previews.
    • Updated site navigation and runner README to show standardized workflow usage and runner guidance.
  • Improvements

    • Introduced a two-step docs preview flow (build + deploy) and enhanced deployment status reporting for preview environments.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 6, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 6, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 6, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot
Copy link
Copy Markdown

@bryan-cox: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • Update hack/github-actions-runner/README.md to reflect the caller + reusable workflow pattern adopted across all GHA workflows
  • Add new MkDocs page documenting all GHA workflows and the reusable architecture
  • Update docs-preview page to reference the current docs-build + docs-deploy split

Test plan

  • Docs Build GHA workflow triggers on this PR
  • Docs Deploy Preview deploys successfully
  • Preview site renders the new GitHub Actions Workflows page correctly

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request documents and implements a caller + reusable GitHub Actions workflow pattern for HyperShift CI, adds a dedicated GitHub Actions guide, updates docs preview docs to a two-workflow build/deploy split, and updates the runner README with caller/reusable examples. It adds nav entries to docs, and enhances .github/workflows/docs-deploy.yaml with a post-deploy step that sets a GitHub Deployment status (including environment_url) based on the deployed PR artifact and workflow_run head SHA.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Contributor as Contributor/PR
  participant GitHub as GitHub (Actions)
  participant Caller as Caller Workflow
  participant Reusable as Reusable Workflow (`@main`)
  participant Runner as ARC Runner (self-hosted)
  participant Artifact as Actions Artifact (docs-site)
  participant DocsDeploy as Docs Deploy Workflow
  participant Cloudflare as Cloudflare Pages
  participant GHDeploy as GitHub Deployments API

  Contributor->>GitHub: Open PR (changes under docs/)
  GitHub->>Caller: Trigger pull_request caller workflow
  Caller->>Reusable: uses: reusable-workflow.yaml@main (workflow_call)
  Reusable->>Runner: run jobs on arc-runner-set
  Runner->>Reusable: build docs, produce site
  Reusable->>Artifact: upload docs-site artifact
  Artifact->>DocsDeploy: artifact available (workflow_run trigger)
  GitHub->>DocsDeploy: workflow_run (on: workflow_run)
  DocsDeploy->>Artifact: download docs-site artifact
  DocsDeploy->>Cloudflare: deploy site (compute preview URL)
  DocsDeploy->>GHDeploy: query deployment by head_sha, set deployment status + environment_url
  GHDeploy-->>GitHub: Deployment status updated
  GitHub-->>Contributor: "View deployment" link in PR (docs-preview environment)
Loading
🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating GitHub Actions documentation to reflect the reusable workflow pattern.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR contains no Ginkgo tests. All changes are documentation (Markdown) and configuration files (YAML). The check for stable test names is not applicable.
Test Structure And Quality ✅ Passed Custom check requires Ginkgo test code review. PR contains only documentation, MkDocs config, and GitHub Actions YAML—no test code present. Check not applicable.
Microshift Test Compatibility ✅ Passed PR contains only documentation and configuration updates. No new Ginkgo e2e tests are added, so this check does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR contains no new Ginkgo e2e tests. All changes are documentation and GitHub Actions workflow configuration files. The SNO compatibility check is not applicable to non-test changes.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only documentation and GitHub Actions workflow updates. No deployment manifests, operator code, or Kubernetes controllers present. Check not applicable.
Ote Binary Stdout Contract ✅ Passed PR modifies only documentation and CI config files (Markdown and YAML), not test code. The OTE Binary Stdout Contract check applies to process-level test code which is not present here.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any Ginkgo e2e tests. It only modifies documentation and GitHub Actions configuration files. The IPv6/disconnected network test compatibility check is not applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added area/ci-tooling Indicates the PR includes changes for CI or tooling area/documentation Indicates the PR includes changes for documentation approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-area labels May 6, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/content/how-to/ci/github-actions.md (1)

28-29: ⚡ Quick win

Avoid absolute security wording for @main pinning.

Line 28 overstates the guarantee. The @main reference pinning ensures the called reusable workflow comes from main, but does not prevent PRs from modifying the caller workflow itself (which specifies the uses: ref). Rephrase this as risk reduction and note that caller workflow protection is essential.

✏️ Suggested wording
-- **Security** — callers pin reusable workflows to `@main`, ensuring PRs cannot modify the workflow code they run under.
+- **Security** — callers pin reusable workflows to `@main`, which reduces the risk of PRs changing reusable job logic. Protect caller workflows (for example with branch protection/CODEOWNERS) so untrusted PRs cannot alter the called ref.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/how-to/ci/github-actions.md` around lines 28 - 29, Reword the
sentence that currently states "**Security** — callers pin reusable workflows to
`@main`, ensuring PRs cannot modify the workflow code they run under." to avoid
absolute language: say that pinning the reusable workflow reference to `@main`
reduces the risk of a PR altering the called reusable workflow, but it does not
prevent PRs from changing the caller workflow (the file that sets the `uses:`
ref); also add a short note that protecting caller workflows (branch
protections/required reviews) is essential to maintain the intended security
model.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/content/how-to/ci/github-actions.md`:
- Around line 28-29: Reword the sentence that currently states "**Security** —
callers pin reusable workflows to `@main`, ensuring PRs cannot modify the
workflow code they run under." to avoid absolute language: say that pinning the
reusable workflow reference to `@main` reduces the risk of a PR altering the
called reusable workflow, but it does not prevent PRs from changing the caller
workflow (the file that sets the `uses:` ref); also add a short note that
protecting caller workflows (branch protections/required reviews) is essential
to maintain the intended security model.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 31514dd1-eaf5-4cab-8b62-3973a2abbcd9

📥 Commits

Reviewing files that changed from the base of the PR and between b0a10c5 and 7400efb.

⛔ Files ignored due to path filters (1)
  • docs/content/reference/aggregated-docs.md is excluded by !docs/content/reference/aggregated-docs.md
📒 Files selected for processing (4)
  • docs/content/how-to/ci/docs-preview.md
  • docs/content/how-to/ci/github-actions.md
  • docs/mkdocs.yml
  • hack/github-actions-runner/README.md

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.53%. Comparing base (b0a10c5) to head (495b7cd).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8453      +/-   ##
==========================================
+ Coverage   37.49%   37.53%   +0.04%     
==========================================
  Files         751      751              
  Lines       91984    92025      +41     
==========================================
+ Hits        34487    34543      +56     
+ Misses      54854    54841      -13     
+ Partials     2643     2641       -2     

see 5 files with indirect coverage changes

Flag Coverage Δ
cmd-support 32.76% <ø> (+0.12%) ⬆️
cpo-hostedcontrolplane 36.77% <ø> (ø)
cpo-other 37.76% <ø> (+0.03%) ⬆️
hypershift-operator 47.93% <ø> (ø)
other 27.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs-deploy.yaml:
- Around line 49-52: The step unconditionally uses PR_NUMBER to build ENV_URL
which can be empty/corrupt; add a guard validating PR_NUMBER is a non-empty
numeric string (e.g., regex check like digits only) before constructing ENV_URL
and any deployment metadata, and if validation fails either set ENV_URL to an
empty/null value and skip downstream deploy steps or fail early with a clear
message; reference the variables PR_NUMBER, HEAD_SHA and ENV_URL when
implementing the conditional so the assignment only happens when PR_NUMBER
passes validation.
- Around line 53-59: The deployment environment name is hardcoded as
"docs-preview", causing cross-PR interference; update the JSON sent when
creating the deployment (the command that sets DEPLOY_ID via HEAD_SHA and gh api
"repos/${{ github.repository }}/deployments") to use a per-PR environment like
"docs-preview/pr-${PR_NUMBER}" so each PR gets its own environment, and ensure
the subsequent gh api call that posts the status still references that
deployment ID (DEPLOY_ID) and environment_url as before; confirm proper shell
variable expansion/quoting for PR_NUMBER in the JSON payload.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 5d5a87e2-803f-4544-8569-8203e35dee9f

📥 Commits

Reviewing files that changed from the base of the PR and between 7400efb and f31a794.

📒 Files selected for processing (1)
  • .github/workflows/docs-deploy.yaml

Comment thread .github/workflows/docs-deploy.yaml Outdated
Comment thread .github/workflows/docs-deploy.yaml Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs-deploy-reusable.yaml:
- Around line 50-61: Validate that PR_NUMBER is present and a non-empty numeric
value before using it (return/log error and exit if invalid), then derive a
per-PR deployment environment name (e.g.,
ENV_NAME="docs-preview-pr-${PR_NUMBER}") and use that ENV_NAME wherever ENV_URL
and the Deployments API environment are set (replace ENV_URL and the
"environment":"docs-preview" payload value). Also include "auto_inactive": false
in the deployment creation payload (the JSON assigned to DEPLOY_ID) so separate
PR deployments don’t inactivate each other, and ensure the final statuses API
call uses DEPLOY_ID and environment_url built from the validated
PR_NUMBER/ENV_NAME.

In @.github/workflows/docs-deploy.yaml:
- Around line 12-17: The workflow's deploy job currently points to the test
branch reference
"openshift/hypershift/.github/workflows/docs-deploy-reusable.yaml@update-gha-docs";
before merging update that "uses" ref to point to the production branch by
replacing "@update-gha-docs" with "@main" so the deploy job uses the main
reusable workflow (look for the deploy job and the uses string to change).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 5ed634a8-6b2c-4f6f-b494-9b033d4f6b66

📥 Commits

Reviewing files that changed from the base of the PR and between f31a794 and 7ec7748.

📒 Files selected for processing (2)
  • .github/workflows/docs-deploy-reusable.yaml
  • .github/workflows/docs-deploy.yaml

Comment thread .github/workflows/docs-deploy-reusable.yaml Outdated
Comment thread .github/workflows/docs-deploy.yaml Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/docs-deploy.yaml (1)

49-54: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reintroduce the previous guard + per-PR deployment environment isolation.

Line 49 uses PR_NUMBER without validation, and Line 53 hardcodes "environment":"docs-preview". This reopens malformed-metadata risk and cross-PR deployment-state interference.

Suggested patch
           PR_NUMBER="${{ steps.pr.outputs.number }}"
           HEAD_SHA="${{ github.event.workflow_run.head_sha }}"
+          if ! [[ "${PR_NUMBER}" =~ ^[0-9]+$ ]]; then
+            echo "Invalid PR number: '${PR_NUMBER}'"
+            exit 1
+          fi
+          DEPLOY_ENV="docs-preview/pr-${PR_NUMBER}"
           ENV_URL="https://pr-${PR_NUMBER}.hypershift.pages.dev"

-          DEPLOY_ID=$(echo '{"ref":"'"${HEAD_SHA}"'","environment":"docs-preview","auto_merge":false,"required_contexts":[]}' \
+          DEPLOY_ID=$(echo '{"ref":"'"${HEAD_SHA}"'","environment":"'"${DEPLOY_ENV}"'","auto_merge":false,"required_contexts":[]}' \
             | gh api "repos/${{ github.repository }}/deployments" --input - --jq '.id')
In the GitHub Deployments API, when creating a successful deployment status, does default auto_inactive affect previous successful deployments in the same environment?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docs-deploy.yaml around lines 49 - 54, Validate PR_NUMBER
is present and numeric before proceeding (fail fast if empty/invalid), and
create a per-PR deployment environment name instead of the fixed "docs-preview"
(e.g., ENV_NAME="docs-preview-pr-${PR_NUMBER}") so deployments are isolated per
PR; then use that ENV_NAME in the gh api payload when setting DEPLOY_ID and
ensure the JSON payload is produced safely (avoid manual string concatenation)
so the "environment" field is well-formed and cannot leak between PRs —
reference PR_NUMBER, ENV_URL/ENV_NAME, HEAD_SHA and the DEPLOY_ID gh api call in
the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs-deploy.yaml:
- Around line 54-57: Ensure DEPLOY_ID is validated after it's assigned (the gh
api call that captures the deployment id into DEPLOY_ID) before invoking the
second gh api to post a status; specifically check that DEPLOY_ID is non-empty
and numeric and if it is not, emit a clear error and exit non-zero so the script
does not call /deployments/${DEPLOY_ID}/statuses with null/empty. Reference the
DEPLOY_ID variable and the two gh api commands (the one that sets DEPLOY_ID and
the subsequent gh api "repos/${{ github.repository
}}/deployments/${DEPLOY_ID}/statuses") and add a simple conditional guard that
logs the failure and aborts when DEPLOY_ID is invalid.

---

Duplicate comments:
In @.github/workflows/docs-deploy.yaml:
- Around line 49-54: Validate PR_NUMBER is present and numeric before proceeding
(fail fast if empty/invalid), and create a per-PR deployment environment name
instead of the fixed "docs-preview" (e.g.,
ENV_NAME="docs-preview-pr-${PR_NUMBER}") so deployments are isolated per PR;
then use that ENV_NAME in the gh api payload when setting DEPLOY_ID and ensure
the JSON payload is produced safely (avoid manual string concatenation) so the
"environment" field is well-formed and cannot leak between PRs — reference
PR_NUMBER, ENV_URL/ENV_NAME, HEAD_SHA and the DEPLOY_ID gh api call in the
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 2e5abd61-0041-4998-87bf-a3034bdf396d

📥 Commits

Reviewing files that changed from the base of the PR and between 7ec7748 and 37e2e95.

📒 Files selected for processing (1)
  • .github/workflows/docs-deploy.yaml

Comment thread .github/workflows/docs-deploy.yaml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
.github/workflows/docs-deploy.yaml (2)

53-59: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use a per-PR deployment environment instead of shared docs-preview.

Using one shared environment can cause deployment lifecycle collisions across open PR previews. Isolate by PR (for example docs-preview/pr-${PR_NUMBER}) when creating/updating deployment status.

Suggested patch
           PR_NUMBER="${{ steps.pr.outputs.number }}"
           HEAD_SHA="${{ github.event.workflow_run.head_sha }}"
+          DEPLOY_ENV="docs-preview/pr-${PR_NUMBER}"
           ENV_URL="https://pr-${PR_NUMBER}.hypershift.pages.dev"

-          DEPLOY_ID=$(echo '{"ref":"'"${HEAD_SHA}"'","environment":"docs-preview","auto_merge":false,"required_contexts":[]}' \
+          DEPLOY_ID=$(echo '{"ref":"'"${HEAD_SHA}"'","environment":"'"${DEPLOY_ENV}"'","auto_merge":false,"required_contexts":[]}' \
             | gh api "repos/${{ github.repository }}/deployments" --input - --jq '.id')

           gh api "repos/${{ github.repository }}/deployments/${DEPLOY_ID}/statuses" \
             -f state="success" \
+            -f environment="${DEPLOY_ENV}" \
             -f environment_url="${ENV_URL}" \
             -f description="Docs preview for PR #${PR_NUMBER}"
In the GitHub REST Deployments API, when creating deployment statuses, does successful status creation auto-inactivate prior deployments in the same environment by default (`auto_inactive=true`)?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docs-deploy.yaml around lines 53 - 59, The workflow uses a
shared deployment environment "docs-preview" which can cause collisions; update
the deployment creation and status calls to use a per-PR environment name like
docs-preview/pr-${PR_NUMBER} instead of the static "docs-preview", i.e.
construct the environment string from PR_NUMBER and pass it to the gh api call
that creates the deployment (the invocation that produces DEPLOY_ID via
"repos/${{ github.repository }}/deployments") and to the subsequent statuses
call that posts the success (the gh api call that uses DEPLOY_ID and sets state,
environment_url/ENV_URL, description); also ensure you pass auto_inactive=true
when creating/updating statuses so prior deployments in the same environment are
inactivated.

49-56: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Validate PR_NUMBER and DEPLOY_ID before using them in downstream calls.

Both values are used as trusted identifiers, but neither is validated. A simple numeric guard avoids malformed deployment/status API calls and makes failures explicit.

Suggested patch
           PR_NUMBER="${{ steps.pr.outputs.number }}"
           HEAD_SHA="${{ github.event.workflow_run.head_sha }}"
+          if ! [[ "${PR_NUMBER}" =~ ^[0-9]+$ ]]; then
+            echo "Invalid PR number: '${PR_NUMBER}'"
+            exit 1
+          fi
           ENV_URL="https://pr-${PR_NUMBER}.hypershift.pages.dev"

           DEPLOY_ID=$(echo '{"ref":"'"${HEAD_SHA}"'","environment":"docs-preview","auto_merge":false,"required_contexts":[]}' \
             | gh api "repos/${{ github.repository }}/deployments" --input - --jq '.id')
+          if ! [[ "${DEPLOY_ID}" =~ ^[0-9]+$ ]]; then
+            echo "Failed to create deployment. DEPLOY_ID='${DEPLOY_ID}'"
+            exit 1
+          fi

           gh api "repos/${{ github.repository }}/deployments/${DEPLOY_ID}/statuses" \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docs-deploy.yaml around lines 49 - 56, Validate PR_NUMBER
is a non-empty integer and DEPLOY_ID is present and numeric before they are
used; after setting PR_NUMBER and after computing DEPLOY_ID check PR_NUMBER
matches a numeric regex (e.g. /^[0-9]+$/) and that DEPLOY_ID is non-empty and
numeric, and if either check fails echo a clear error including the variable
name and exit non-zero so the workflow doesn't call gh api with malformed
identifiers; perform these checks before using ENV_URL or calling gh api
"repos/.../deployments/${DEPLOY_ID}/statuses".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.github/workflows/docs-deploy.yaml:
- Around line 53-59: The workflow uses a shared deployment environment
"docs-preview" which can cause collisions; update the deployment creation and
status calls to use a per-PR environment name like docs-preview/pr-${PR_NUMBER}
instead of the static "docs-preview", i.e. construct the environment string from
PR_NUMBER and pass it to the gh api call that creates the deployment (the
invocation that produces DEPLOY_ID via "repos/${{ github.repository
}}/deployments") and to the subsequent statuses call that posts the success (the
gh api call that uses DEPLOY_ID and sets state, environment_url/ENV_URL,
description); also ensure you pass auto_inactive=true when creating/updating
statuses so prior deployments in the same environment are inactivated.
- Around line 49-56: Validate PR_NUMBER is a non-empty integer and DEPLOY_ID is
present and numeric before they are used; after setting PR_NUMBER and after
computing DEPLOY_ID check PR_NUMBER matches a numeric regex (e.g. /^[0-9]+$/)
and that DEPLOY_ID is non-empty and numeric, and if either check fails echo a
clear error including the variable name and exit non-zero so the workflow
doesn't call gh api with malformed identifiers; perform these checks before
using ENV_URL or calling gh api "repos/.../deployments/${DEPLOY_ID}/statuses".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 54c442d5-de54-4172-a9fb-5a8d9371fb6d

📥 Commits

Reviewing files that changed from the base of the PR and between 37e2e95 and e7d4b8d.

⛔ Files ignored due to path filters (1)
  • docs/content/reference/aggregated-docs.md is excluded by !docs/content/reference/aggregated-docs.md
📒 Files selected for processing (5)
  • .github/workflows/docs-deploy.yaml
  • docs/content/how-to/ci/docs-preview.md
  • docs/content/how-to/ci/github-actions.md
  • docs/mkdocs.yml
  • hack/github-actions-runner/README.md
✅ Files skipped from review due to trivial changes (2)
  • docs/mkdocs.yml
  • docs/content/how-to/ci/github-actions.md

- Update hack/github-actions-runner/README.md to document the
  caller + reusable workflow architecture with updated mermaid
  diagram and example workflow pair
- Add new MkDocs page documenting all GitHub Actions workflows,
  the reusable pattern, and how to add new workflows
- Update docs-preview page to reflect the two-workflow
  build/deploy split architecture
- Soften security claim about @main pinning per review feedback
- Add nav entries for GitHub Actions and Sync Community Fork pages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The docs-deploy workflow runs via workflow_run, which executes in
the context of the default branch. This means GitHub deployments
are created against the main SHA rather than the PR head SHA,
preventing the "View deployment" link from appearing on PRs.

Create a GitHub deployment against the workflow_run head SHA and
post a success status with the preview URL. Use per-PR deployment
environments (docs-preview/pr-N) to prevent cross-PR interference
from the auto_inactive default. Validate PR_NUMBER and DEPLOY_ID
before use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bryan-cox bryan-cox marked this pull request as ready for review May 8, 2026 14:38
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 8, 2026
@openshift-ci openshift-ci Bot requested review from muraee and sdminonne May 8, 2026 14:39
@muraee
Copy link
Copy Markdown
Contributor

muraee commented May 8, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@bryan-cox
Copy link
Copy Markdown
Member Author

/override e2e-aks
/override e2e-aws
/override e2e-aws-upgrade-hypershift-operator
/override e2e-azure-self-managed
/override e2e-kubevirt-aws-ovn-reduced
/override e2e-v2-aws

@bryan-cox
Copy link
Copy Markdown
Member Author

/verified bypass

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@bryan-cox: The verified label has been added.

Details

In response to this:

/verified bypass

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

@bryan-cox: /override requires failed status contexts, check run or a prowjob name to operate on.
The following unknown contexts/checkruns were given:

  • e2e-aks
  • e2e-aws
  • e2e-aws-upgrade-hypershift-operator
  • e2e-azure-self-managed
  • e2e-kubevirt-aws-ovn-reduced
  • e2e-v2-aws

Only the following failed contexts/checkruns were expected:

  • CodeRabbit
  • ci/prow/e2e-aks
  • ci/prow/e2e-aws
  • ci/prow/e2e-aws-upgrade-hypershift-operator
  • ci/prow/e2e-azure-self-managed
  • ci/prow/e2e-azure-v2-self-managed
  • ci/prow/e2e-kubevirt-aws-ovn-reduced
  • ci/prow/e2e-v2-aws
  • ci/prow/images
  • ci/prow/okd-scos-images
  • ci/prow/security
  • ci/prow/verify-deps
  • envtest-kube / Envtest Vanilla Kube ${{ matrix.version }}
  • envtest-ocp / Envtest OCP (K8s ${{ matrix.version }})
  • pull-ci-openshift-hypershift-main-e2e-aks
  • pull-ci-openshift-hypershift-main-e2e-aws
  • pull-ci-openshift-hypershift-main-e2e-aws-upgrade-hypershift-operator
  • pull-ci-openshift-hypershift-main-e2e-azure-self-managed
  • pull-ci-openshift-hypershift-main-e2e-azure-v2-self-managed
  • pull-ci-openshift-hypershift-main-e2e-kubevirt-aws-ovn-reduced
  • pull-ci-openshift-hypershift-main-e2e-v2-aws
  • pull-ci-openshift-hypershift-main-images
  • pull-ci-openshift-hypershift-main-okd-scos-images
  • pull-ci-openshift-hypershift-main-security
  • pull-ci-openshift-hypershift-main-verify-deps
  • tide

If you are trying to override a checkrun that has a space in it, you must put a double quote on the context.

Details

In response to this:

/override e2e-aks
/override e2e-aws
/override e2e-aws-upgrade-hypershift-operator
/override e2e-azure-self-managed
/override e2e-kubevirt-aws-ovn-reduced
/override e2e-v2-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@bryan-cox
Copy link
Copy Markdown
Member Author

/override ci/prow/e2e-aks
/override ci/prow/e2e-aws
/override ci/prow/e2e-aws-upgrade-hypershift-operator
/override ci/prow/e2e-azure-self-managed
/override ci/prow/e2e-azure-v2-self-managed
/override ci/prow/e2e-kubevirt-aws-ovn-reduced
/override ci/prow/e2e-v2-aws

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

@bryan-cox: Overrode contexts on behalf of bryan-cox: ci/prow/e2e-aks, ci/prow/e2e-aws, ci/prow/e2e-aws-upgrade-hypershift-operator, ci/prow/e2e-azure-self-managed, ci/prow/e2e-azure-v2-self-managed, ci/prow/e2e-kubevirt-aws-ovn-reduced, ci/prow/e2e-v2-aws

Details

In response to this:

/override ci/prow/e2e-aks
/override ci/prow/e2e-aws
/override ci/prow/e2e-aws-upgrade-hypershift-operator
/override ci/prow/e2e-azure-self-managed
/override ci/prow/e2e-azure-v2-self-managed
/override ci/prow/e2e-kubevirt-aws-ovn-reduced
/override ci/prow/e2e-v2-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@bryan-cox bryan-cox closed this May 8, 2026
@bryan-cox bryan-cox deleted the update-gha-docs branch May 8, 2026 16:40
@bryan-cox bryan-cox restored the update-gha-docs branch May 8, 2026 16:43
@bryan-cox bryan-cox reopened this May 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@bryan-cox: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • Update hack/github-actions-runner/README.md to reflect the caller + reusable workflow pattern adopted across all GHA workflows
  • Add new MkDocs page documenting all GHA workflows and the reusable architecture
  • Update docs-preview page to reference the current docs-build + docs-deploy split

Test plan

  • Docs Build GHA workflow triggers on this PR
  • Docs Deploy Preview deploys successfully
  • Preview site renders the new GitHub Actions Workflows page correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

  • Added detailed GitHub Actions CI docs covering caller+reusable workflow patterns, workflow examples, and a new how-to page for docs previews.

  • Updated site navigation and runner README to show standardized workflow usage and runner guidance.

  • Improvements

  • Introduced a two-step docs preview flow (build + deploy) and enhanced deployment status reporting for preview environments.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@bryan-cox
Copy link
Copy Markdown
Member Author

/override ci/prow/e2e-aks
/override ci/prow/e2e-aws
/override ci/prow/e2e-aws-upgrade-hypershift-operator
/override ci/prow/e2e-azure-self-managed
/override ci/prow/e2e-azure-v2-self-managed
/override ci/prow/e2e-kubevirt-aws-ovn-reduced
/override ci/prow/e2e-v2-aws

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

@bryan-cox: Overrode contexts on behalf of bryan-cox: ci/prow/e2e-aks, ci/prow/e2e-aws, ci/prow/e2e-aws-upgrade-hypershift-operator, ci/prow/e2e-azure-self-managed, ci/prow/e2e-azure-v2-self-managed, ci/prow/e2e-kubevirt-aws-ovn-reduced, ci/prow/e2e-v2-aws

Details

In response to this:

/override ci/prow/e2e-aks
/override ci/prow/e2e-aws
/override ci/prow/e2e-aws-upgrade-hypershift-operator
/override ci/prow/e2e-azure-self-managed
/override ci/prow/e2e-azure-v2-self-managed
/override ci/prow/e2e-kubevirt-aws-ovn-reduced
/override ci/prow/e2e-v2-aws

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot Bot merged commit bded456 into openshift:main May 8, 2026
51 checks passed
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

@bryan-cox: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ci-tooling Indicates the PR includes changes for CI or tooling area/documentation Indicates the PR includes changes for documentation jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants