Closed
Conversation
`pull_request_target` runs against the base branch SHA, so the check run and any status the CLA action posts land on the wrong commit. This causes org-level required-check rulesets (like "CLA Required") to stay stuck on "expected" because GitHub never sees the `cla / cla` context on the actual PR head. Add a step that explicitly posts the CLA outcome (success or failure) to `github.event.pull_request.head.sha` after the CLA action runs. Also add `workflow_call` to the job/step conditions so the workflow works correctly when invoked as a reusable workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workflow_callto job/stepifconditions for reusable workflow compatibilityProblem
pull_request_targetworkflows run against the base branch SHA. The CLA action's check run and any status it posts land on that base SHA, not the PR head commit. When an org-level ruleset requirescla / claon the PR head (like the "CLA Required" ruleset), the check stays stuck on "expected" indefinitely.This affects all repos in the org that use this reusable CLA workflow.
Fix
A new step runs after the CLA action (
if: always()) and posts a commit status togithub.event.pull_request.head.shawith the correct outcome. Theifguard ongithub.event.pull_request.head.shaensures it only runs for PR events, not issue comments.Test plan
cla / clacheck appears on the PR head after mergerecheck/ signing) path still works