Skip to content

Commit 5b03c7e

Browse files
Simplify CLA gate status handling
1 parent d93b381 commit 5b03c7e

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/cla-gate.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
name: CLA Gate
22

3-
# This workflow publishes a repository-owned commit status named `CLA Gate`.
4-
# Make `CLA Gate` required instead of requiring CLA Assistant's raw `license/cla`
5-
# status directly. That lets merge queue entries pass without waiting for CLA
6-
# Assistant to report on the synthetic merge-group SHA, while pull requests still
7-
# mirror the real CLA Assistant result.
3+
# This workflow makes CLA checks work with merge queue entries. Merge groups get
4+
# a repository-owned `CLA Gate` commit status on the synthetic queue SHA, while
5+
# pull request/status events use this Actions job result based on CLA Assistant's
6+
# raw `license/cla` status.
87
#
9-
# SECURITY: This workflow uses pull_request_target so it can publish commit
10-
# statuses on external PRs. It must never check out, build, or execute PR code.
8+
# SECURITY: This workflow uses pull_request_target so it can inspect statuses on
9+
# external PRs. It must never check out, build, or execute PR code.
1110

1211
on:
1312
pull_request_target:
@@ -98,9 +97,12 @@ jobs:
9897
return;
9998
}
10099
101-
await postStatus({
102-
sha: targetSha,
103-
state: status.state,
104-
description: status.description || undefined,
105-
targetUrl: status.target_url || undefined,
106-
});
100+
if (status.state === "success") {
101+
core.info(`license/cla is success for ${targetSha}`);
102+
return;
103+
}
104+
105+
const state = status.state || "missing";
106+
const description = status.description || "license/cla status is missing";
107+
const targetUrl = status.target_url ? ` (${status.target_url})` : "";
108+
core.setFailed(`license/cla is ${state}: ${description}${targetUrl}`);

0 commit comments

Comments
 (0)