You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-22Lines changed: 5 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,11 @@ A minimal job whose only purpose is to fire `workflow_run` so the main workflow
29
29
30
30
```yaml
31
31
name: 'API Surface Check'
32
+
33
+
# Minimal pull_request workflow whose only job is to fire workflow_run for the
34
+
# api-surface-comment workflow (which has pull-requests:write even on fork PRs
35
+
# and runs the actual analysis from trusted action code).
36
+
32
37
on:
33
38
pull_request:
34
39
paths-ignore:
@@ -123,28 +128,6 @@ jobs:
123
128
124
129
The PR number and base ref are resolved automatically from the `workflow_run` event payload — you don't pass them.
125
130
126
-
## Sub-actions
127
-
128
-
The main action is a thin orchestrator. The work it can do — analysis and comment posting — is also exposed as standalone sub-actions for advanced setups (custom workflows, smoke testing, or scenarios that don't fit the two-workflow `pull_request`/`workflow_run` pattern).
129
-
130
-
### `composer/api-surface-check/analyze`
131
-
132
-
Runs the full analysis: setup PHP, install action deps, optionally install project deps, snapshot HEAD and BASE, diff, and write `comment-body.txt`. Assumes the consumer has already checked out a git tree with HEAD and `base-ref` reachable.
133
-
134
-
Inputs are the same as the main action's analysis-related inputs (`paths`, `source-roots`, `working-directory`, `install-dependencies`, etc.) plus a required `base-ref`. Outputs `has-changes` (`true`/`false`) and `output-dir`.
135
-
136
-
### `composer/api-surface-check/post-comment`
137
-
138
-
Posts, updates, or deletes a PR comment based on the `comment-body.txt` produced by `analyze`. Run it unconditionally once the PR is resolved — when given an empty/missing body it deletes any previously-posted bot comment, which fixes stale comments after a PR is updated to revert API additions.
| `pr-number` | _required_ | PR number to post / update / delete the comment on. |
143
-
| `output-dir` | `api-surface-result` | Directory containing `comment-body.txt`. An empty/missing body deletes any existing marked comment. |
144
-
| `comment-marker` | `<!-- api-surface-bot -->` | HTML marker that identifies previous bot comments. |
145
-
146
-
Requires `GH_TOKEN` env (passed in by the consumer) with `pull-requests: write`.
147
-
148
131
## Resolving vendor parents
149
132
150
133
By default the action only resolves classes that live under `source-roots`. If your code extends classes that come from Composer dependencies (e.g. `class Foo extends \Symfony\…`), better-reflection can't follow those parents and the introduction-point check is incomplete — methods defined on a vendor parent may be wrongly flagged as new on your subclass.
0 commit comments