Skip to content

Commit 467df51

Browse files
committed
Test against PR ref not HEAD
1 parent 9442320 commit 467df51

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/preview-readme.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
with:
1818
ref: ${{ github.event.pull_request.head.ref }}
1919

20+
- name: Save HEAD SHA before helm-docs
21+
id: save-sha
22+
run: |
23+
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
24+
2025
- name: Render helm docs inside the README.md
2126
uses: losisin/helm-docs-github-action@v1
2227
with:
@@ -25,7 +30,7 @@ jobs:
2530
- name: Check for README changes
2631
id: check-changes
2732
run: |
28-
if git diff --quiet HEAD -- README.md
33+
if git diff --quiet ${{ steps.save-sha.outputs.sha }} -- README.md
2934
then
3035
echo "has_changes=false" >> $GITHUB_OUTPUT
3136
else
@@ -37,7 +42,7 @@ jobs:
3742
if: steps.check-changes.outputs.has_changes == 'true'
3843
run: |
3944
echo 'diff<<EOF' >> $GITHUB_OUTPUT
40-
git diff HEAD -- README.md >> $GITHUB_OUTPUT
45+
git diff ${{ steps.save-sha.outputs.sha }} -- README.md >> $GITHUB_OUTPUT
4146
echo 'EOF' >> $GITHUB_OUTPUT
4247
4348
- name: Find and hide outdated comments

0 commit comments

Comments
 (0)