Skip to content

Commit 15e9a32

Browse files
committed
Allow specifying a tag that should be used as a baseline for API breakage checks
1 parent 79ebcef commit 15e9a32

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/soundness.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
type: string
1212
description: "Path to a file that will be passed as --breakage-allowlist-path to swift package diagnose-api-breaking-changes"
1313
default: ""
14+
api_breakage_check_baseline:
15+
type: string
16+
description: "The tag against which API breakages that should be used as the baseline for the API breakage check. By default the PR base is used."
17+
default: ""
1418
api_breakage_check_container_image:
1519
type: string
1620
description: "Container image for the API breakage check job. Defaults to latest Swift Ubuntu image."
@@ -103,11 +107,16 @@ jobs:
103107
run: ${{ inputs.linux_pre_build_command }}
104108
- name: Run API breakage check
105109
run: |
106-
git fetch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} ${GITHUB_BASE_REF}:pull-base-ref
110+
if [[ -z '${{ inputs.api_breakage_check_baseline }}' ]]; then
111+
git fetch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} ${GITHUB_BASE_REF}:pull-base-ref
112+
BASELINE_REF='pull-base-ref'
113+
else
114+
BASELINE_REF='${{ inputs.api_breakage_check_baseline }}'
115+
fi
107116
if [[ -z '${{ inputs.api_breakage_check_allowlist_path }}' ]]; then
108-
swift package diagnose-api-breaking-changes pull-base-ref
117+
swift package diagnose-api-breaking-changes "$BASELINE_REF"
109118
else
110-
swift package diagnose-api-breaking-changes pull-base-ref --breakage-allowlist-path '${{ inputs.api_breakage_check_allowlist_path }}'
119+
swift package diagnose-api-breaking-changes "$BASELINE_REF" --breakage-allowlist-path '${{ inputs.api_breakage_check_allowlist_path }}'
111120
fi
112121
113122
docs-check:

0 commit comments

Comments
 (0)