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
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ For every modified PHP file the action:
10
10
2. Snapshots the same files on the **base** ref (extracted with `git archive`).
11
11
3. Diffs the two snapshots. A method or constant is only reported on a class when its **introduction point** is the class itself — implementations of existing interface methods, overrides of parent methods, or members already declared on a parent in the unchanged code are not flagged.
12
12
13
-
The result is written to a directory containing `comment-body.txt` (a markdown body, possibly empty) and `pr-number.txt`. A companion `scripts/post-comment.sh`posts/updates/deletes a PR comment based on that artifact.
13
+
The result is written to a directory containing `comment-body.txt` (a markdown body, possibly empty). A companion `post-comment` sub-action posts, updates, or deletes a PR comment based on that body.
14
14
15
15
## Why static reflection?
16
16
@@ -84,8 +84,10 @@ jobs:
84
84
echo "should-run=true" >> "$GITHUB_OUTPUT"
85
85
fi
86
86
87
+
# Resolve the PR unconditionally so we can clean up a stale comment
88
+
# even when preflight says no API-relevant changes (e.g. a PR was
89
+
# updated to revert previously-reported additions).
| `base-ref` | _required_ | Git ref to compare HEAD against (e.g. `origin/main`). |
160
-
| `pr-number` | (empty) | Saved alongside the comment body for the comment workflow. |
161
166
| `output-dir` | `api-surface-result` | Directory the artifact is written to. |
162
167
| `comment-marker` | `<!-- api-surface-bot -->` | HTML marker used to identify previous bot comments. |
163
168
@@ -184,12 +189,13 @@ Quickly scans the PR diff for tokens that could affect the API surface. Writes `
184
189
185
190
### `composer/api-surface-check/post-comment`
186
191
187
-
Posts, updates, or deletes a PR comment based on the artifact produced by the main action. Use it in the comment workflow.
192
+
Posts, updates, or deletes a PR comment based on the artifact produced by the main action. Use it in the comment workflow. Run it unconditionally once the PR is resolved — when given an empty/missing `comment-body.txt` it deletes any previously-posted bot comment, which fixes stale comments after a PR is updated to revert API additions.
Copy file name to clipboardExpand all lines: post-comment/action.yml
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,11 @@ branding:
6
6
color: 'blue'
7
7
8
8
inputs:
9
+
pr-number:
10
+
description: 'PR number to post / update / delete the comment on.'
11
+
required: true
9
12
output-dir:
10
-
description: 'Directory containing comment-body.txt and pr-number.txt produced by the analysis action.'
13
+
description: 'Directory containing the comment-body.txt produced by the analysis action. An empty or missing body deletes any existing marked comment (used for stale-comment cleanup when analysis is skipped).'
0 commit comments