Skip to content

Commit d2ca42e

Browse files
authored
fetch?
1 parent 3bce9c8 commit d2ca42e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.github/workflows/Label.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ jobs:
88
- uses: actions/checkout@v6
99
with:
1010
submodules: recursive
11-
ref: ${{ github.event.pull_request.head.sha }} # Check out the pull request HEAD commit instead of the merge commit
1211
- name: If there are changes in PublicApi.Shipped.txt, fail the workflow
1312
if: github.head_ref != 'action/ship-publicapi' # Same branch name specified in Release.yml
1413
run: |
15-
git fetch origin ${{ github.base_ref }}
16-
$changes = git diff --numstat --shortstat origin/${{ github.base_ref }}...HEAD -- '**/PublicApi.Shipped.txt'
14+
git fetch origin HEAD # By default, actions/checkout does not fetch commit history, we fetch it here
15+
$changes = git diff --numstat --shortstat ${{ github.base_ref }}...HEAD -- '**/PublicApi.Shipped.txt'
1716
Write-Output "$changes"
1817
if ($changes) {
1918
Write-Error "Changes detected in PublicApi.Shipped.txt files. Public API changes must be shipped through the release process, not in regular pull requests."

0 commit comments

Comments
 (0)