|
1 | 1 | name: CLA Gate |
2 | 2 |
|
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. |
8 | 7 | # |
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. |
11 | 10 |
|
12 | 11 | on: |
13 | 12 | pull_request_target: |
|
98 | 97 | return; |
99 | 98 | } |
100 | 99 |
|
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