fix(workflow): fix release deploy - #12598
Conversation
WalkthroughThe reusable documentation workflow now accepts an ChangesRelease documentation deployment
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
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/documentation.yml:
- Line 32: Update the deployment condition in the workflow to require
needs.check-permissions.result == 'success' for all deployments, while allowing
inputs.is-release to bypass only the authorization output check. Preserve the
existing non-release permission requirement and prevent deployment when the
check-permissions job fails.
- Line 48: Update the checkout permission-gating logic in the documentation
workflow so reusable calls with is-release set to false still perform a
checkout; add the fallback condition (!github.event_name || inputs.is-release),
or explicitly include every supported non-release caller while preserving
existing pull_request_target and issue_comment behavior.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2f0319d3-cc44-421c-bdc6-2b4c0dd9a1b2
📒 Files selected for processing (2)
.github/workflows/documentation.yml.github/workflows/release.yml
| always() && | ||
| !cancelled() && | ||
| (github.event_name == 'workflow_call' || needs.check-permissions.outputs.allowed == 'true') | ||
| (inputs.is-release || needs.check-permissions.outputs.allowed == 'true') |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Do not deploy when the permission-check job fails.
Because always() is combined with inputs.is-release, a release deployment proceeds even if check-permissions fails. Require needs.check-permissions.result == 'success'; the release flag should bypass only the PR authorization result, not a failed permission check.
🤖 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/documentation.yml at line 32, Update the deployment
condition in the workflow to require needs.check-permissions.result == 'success'
for all deployments, while allowing inputs.is-release to bypass only the
authorization output check. Preserve the existing non-release permission
requirement and prevent deployment when the check-permissions job fails.
|
|
||
| - name: Check out project | ||
| if: github.event_name == 'workflow_call' | ||
| if: inputs.is-release |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== workflow files =="
git ls-files .github/workflows | sed -n '1,120p'
echo
echo "== documentation workflow =="
if [ -f .github/workflows/documentation.yml ]; then
cat -n .github/workflows/documentation.yml
fi
echo
echo "== references to documentation workflow and input is-release =="
rg -n "documentation\.yml|--workflow|is-release|pull_request_target|issue_comment|permissions:" .github/workflows .github 2>/dev/null || trueRepository: patternfly/patternfly-react
Length of output: 4731
Cover reusable is-release: false call sites.
documentation.yml only auto-checks out pull_request_target and issue_comment; manual non-release reusable workflow calls get past permission gating but run without checkout. Add a fallback checkout guarded by (!github.event_name || inputs.is-release) or explicitly cover each supported caller.
🤖 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/documentation.yml at line 48, Update the checkout
permission-gating logic in the documentation workflow so reusable calls with
is-release set to false still perform a checkout; add the fallback condition
(!github.event_name || inputs.is-release), or explicitly include every supported
non-release caller while preserving existing pull_request_target and
issue_comment behavior.
What: Closes #12540
It seems that
github.event_name == 'workflow_call'doesn't return true when the release workflow steps run (event_name evaluates to 'push'). Refactored to instead explicitly pipe a flag for the release workflow.Assisted by Cursor AI.