Skip to content

Commit dc68e03

Browse files
committed
CI: Log right range for New-Versions extraction
1 parent 83f5e50 commit dc68e03

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/haskell-actions.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20+
with:
21+
# 0 indicates all history for all branches and tags
22+
fetch-depth: 0
2023

2124
- name: Set up GHC ${{ matrix.ghc-version }}
2225
uses: haskell-actions/setup@v2
@@ -27,16 +30,18 @@ jobs:
2730
cabal-update: true
2831

2932
- name: Extract New-Versions git trailer from Renovate
33+
if: ${{ github.event_name == 'pull_request' }}
34+
env:
35+
GITHUB_SHA: "{{ github.event.pull_request.head.sha }}"
3036
run: |
3137
if [ ! -f cabal.project ]
3238
then echo 'packages: .' > cabal.project
3339
fi
34-
for constraint in $(git log "--format=%(trailers:key=New-Versions,valueonly=true)" -1)
40+
echo $GITHUB_SHA
41+
git show $GITHUB_SHA
42+
for constraint in $(git log "--format=%(trailers:key=New-Versions,valueonly=true)" ${GITHUB_SHA}^1 ${GITHUB_SHA}^2)
3543
do echo "constraints: $constraint" >> cabal.project
3644
done
37-
38-
- name: Show cabal.project
39-
run: |
4045
cat cabal.project
4146
4247
- name: Configure the build

0 commit comments

Comments
 (0)