Skip to content

Commit 29de98c

Browse files
authored
Publish the ABI check comment and labels via (#3276)
Signed-off-by: Tomoya.Fujita <fujita.tomoya@triorb.co.jp>
1 parent ffa07ee commit 29de98c

2 files changed

Lines changed: 48 additions & 3 deletions

File tree

.github/workflows/abi-report.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Publishes the result of the "abi" workflow (abi.yaml) on the pull request:
2+
# one sticky comment with the per-library ABI verdicts and the
3+
# "ABI compatible" / "ABI break" label.
4+
#
5+
# This is a separate workflow because abi.yaml builds and diffs the pull
6+
# request's own code. For pull requests from forks GitHub therefore runs it
7+
# with a read-only token, whatever permissions it asks for, and it cannot
8+
# write to the PR. workflow_run workflows instead run the workflow file from
9+
# the default branch of this repository with a normal token; this one never
10+
# checks out or executes anything from the pull request, it only downloads the
11+
# report artifacts the abi run uploaded and posts what they say.
12+
#
13+
# The pass/fail check on the pull request still comes from abi.yaml; this
14+
# workflow only adds the comment and the label. It only starts firing once it
15+
# exists on the default branch, and a first-time contributor's abi run still
16+
# needs a maintainer's approval before anything is published.
17+
#
18+
# See https://github.com/fujitatomoya/ros2-abi-action for details.
19+
name: abi-report
20+
21+
on:
22+
workflow_run:
23+
# Must match the `name:` of abi.yaml.
24+
workflows: [abi]
25+
types: [completed]
26+
27+
jobs:
28+
report:
29+
permissions:
30+
contents: read
31+
pull-requests: write # sticky comment + label
32+
issues: write # label
33+
actions: read # download the abi run's report artifacts
34+
uses: fujitatomoya/ros2-abi-action/.github/workflows/report.yml@main

.github/workflows/abi.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@
2121
# fujitatomoya/libabigail-action (abidiff), one job per library,
2222
# 5. applies REP-0009 policy automatically: released distros (humble/jazzy/kilted/lyrical)
2323
# fail on an incompatible ABI break, rolling is advisory only,
24-
# 6. surfaces per-library verdicts as sticky PR comments, labels, and a pass/fail check.
24+
# 6. surfaces the verdict as a pass/fail check and uploads one report bundle
25+
# (abidiff report + verdict.json) per library.
26+
#
27+
# The sticky PR comment and the "ABI compatible" / "ABI break" labels are NOT
28+
# posted from here (publish: workflow-run). Most rclcpp pull requests come from
29+
# forks, and on pull_request events from a fork GitHub gives this workflow a
30+
# read-only token regardless of the permissions requested below, so any write
31+
# to the PR would fail. abi-report.yaml runs on workflow_run once this workflow
32+
# completes and publishes the comment and labels with a token that may write.
2533
#
2634
# Paired changes in other repositories (e.g. an rcl PR this PR depends on) are
2735
# declared by the PR author in the PR description and applied to the PR side
@@ -41,10 +49,10 @@ on:
4149

4250
jobs:
4351
abi:
52+
# Nothing is written to the pull request from this workflow; the report
53+
# workflow holds the write permissions.
4454
permissions:
4555
contents: read
46-
pull-requests: write
47-
issues: write
4856
uses: fujitatomoya/ros2-abi-action/.github/workflows/check.yml@main
4957
with:
5058
# Colcon package names to build (whitespace-separated); no single package
@@ -63,3 +71,6 @@ jobs:
6371
distro: auto
6472
# auto -> REP-0009: strict on released distros, advisory on rolling.
6573
policy: auto
74+
# Leave the PR comment and labels to abi-report.yaml (workflow_run), so
75+
# pull requests from forks get them too.
76+
publish: workflow-run

0 commit comments

Comments
 (0)