Skip to content

Commit d09f5a8

Browse files
ci: skip OpenShift E2E tests for doc-only PRs (#899)
Add a check-code-changes job to the OpenShift E2E workflow that detects documentation-only PRs and skips the entire E2E pipeline, saving GPU runner time. Uses the same dorny/paths-filter config as ci-pr-checks.yaml. Comment triggers (/ok-to-test, /retest) and workflow_dispatch always run. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a54f1eb commit d09f5a8

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/ci-e2e-openshift.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,53 @@ on:
7171
default: '240'
7272

7373
jobs:
74+
# Check if PR contains code changes (not just docs/metadata)
75+
check-code-changes:
76+
runs-on: ubuntu-latest
77+
permissions:
78+
contents: read
79+
pull-requests: read
80+
outputs:
81+
has_code_changes: ${{ steps.set-output.outputs.has_code_changes }}
82+
steps:
83+
- name: Checkout source
84+
if: github.event_name == 'pull_request'
85+
uses: actions/checkout@v4
86+
87+
- name: Check for code changes
88+
if: github.event_name == 'pull_request'
89+
uses: dorny/paths-filter@v3
90+
id: filter
91+
with:
92+
filters: |
93+
code:
94+
- '!docs/**'
95+
- '!README.md'
96+
- '!CONTRIBUTING.md'
97+
- '!LICENSE'
98+
- '!OWNERS'
99+
- '!PROJECT'
100+
101+
- name: Set output
102+
id: set-output
103+
run: |
104+
if [ "${{ github.event_name }}" != "pull_request" ]; then
105+
# Always run for issue_comment (/ok-to-test, /retest) and workflow_dispatch
106+
echo "has_code_changes=true" >> $GITHUB_OUTPUT
107+
elif [ -n "${{ steps.filter.outputs.code }}" ]; then
108+
echo "has_code_changes=${{ steps.filter.outputs.code }}" >> $GITHUB_OUTPUT
109+
else
110+
echo "has_code_changes=true" >> $GITHUB_OUTPUT
111+
fi
112+
74113
# Gate: Check permissions and handle /ok-to-test for fork PRs.
75114
# - Maintainers (write access): Tests run automatically on pull_request.
76115
# - Fork PRs: Gate succeeds (no failure) so the PR does not show a false red check; E2E runs
77116
# only after a maintainer comments /ok-to-test. Branch protection should require the
78117
# "e2e-openshift" job so merge stays blocked until that run passes.
79118
gate:
119+
needs: check-code-changes
120+
if: needs.check-code-changes.outputs.has_code_changes == 'true'
80121
runs-on: ubuntu-latest
81122
outputs:
82123
should_run: ${{ steps.check.outputs.should_run }}

0 commit comments

Comments
 (0)