Skip to content

Commit 13503d5

Browse files
committed
Avoid spurious api change warnings from automated release PRs
1 parent cdadad6 commit 13503d5

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/detect-api-changes.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,19 @@ jobs:
2828
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
2929
PR_NUMBER: ${{ github.event.pull_request.number }}
3030
REPO: ${{ github.repository }}
31+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
3132
run: |
3233
MARKER="<!-- api-change-detector -->"
3334
34-
# Get list of apidiff files changed in this PR
35-
api_files=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/files" --paginate \
36-
--jq '.[] | select(.filename | startswith("docs/apidiffs/current_vs_latest/")) | .filename')
35+
# Get list of apidiff files changed in this PR.
36+
# otelbot/* PRs (release version bumps, post-release updates) only change the version
37+
# header in apidiff files — treat them as having no API changes so the cleanup path below runs.
38+
if [[ "$HEAD_REF" == otelbot/* ]]; then
39+
api_files=""
40+
else
41+
api_files=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/files" --paginate \
42+
--jq '.[] | select(.filename | startswith("docs/apidiffs/current_vs_latest/")) | .filename')
43+
fi
3744
3845
# Find existing bot comment (if any)
3946
comment_id=$(gh api "repos/${REPO}/issues/${PR_NUMBER}/comments" --paginate \

0 commit comments

Comments
 (0)