Skip to content

Commit 48c5b1b

Browse files
committed
fixing validation workflow
1 parent 33cab83 commit 48c5b1b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/validate-readme.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,51 +33,51 @@ jobs:
3333
- name: Update README.md
3434
run: node update-readme.js
3535

36-
- name: Check for README.md changes
36+
- name: Check for file changes
3737
id: check-diff
3838
run: |
39-
if git diff --exit-code README.md; then
40-
echo "No changes to README.md after running update script."
39+
if git diff --exit-code; then
40+
echo "No changes detected after running update script."
4141
echo "status=success" >> $GITHUB_OUTPUT
4242
else
43-
echo "Changes detected in README.md after running update script."
43+
echo "Changes detected after running update script."
4444
echo "status=failure" >> $GITHUB_OUTPUT
4545
echo "diff<<EOF" >> $GITHUB_OUTPUT
46-
git diff README.md >> $GITHUB_OUTPUT
46+
git diff >> $GITHUB_OUTPUT
4747
echo "EOF" >> $GITHUB_OUTPUT
4848
fi
4949
5050
- name: Output diff to logs for non-write users
5151
if: steps.check-diff.outputs.status == 'failure' && github.event.pull_request.head.repo.permissions.push != true
5252
run: |
53-
echo "::group::README.md diff (changes needed)"
54-
echo "The following changes need to be made to README.md:"
53+
echo "::group::File changes (changes needed)"
54+
echo "The following changes need to be made:"
5555
echo ""
56-
git diff README.md
56+
git diff
5757
echo "::endgroup::"
5858
59-
- name: Comment on PR if README.md needs updating
59+
- name: Comment on PR if files need updating
6060
if: steps.check-diff.outputs.status == 'failure' && github.event.pull_request.head.repo.permissions.push == true
6161
uses: marocchino/sticky-pull-request-comment@v2
6262
with:
6363
header: readme-validation
6464
message: |
65-
## ⚠️ README.md needs to be updated
65+
## ⚠️ Generated files need to be updated
6666
67-
The `update-readme.js` script detected changes that need to be made to the README.md file.
67+
The `update-readme.js` script detected changes that need to be made.
6868
6969
Please run `node update-readme.js` locally and commit the changes before merging this PR.
7070
7171
<details>
7272
<summary>View diff</summary>
73-
73+
7474
```diff
7575
${{ steps.check-diff.outputs.diff }}
7676
```
7777
</details>
7878
79-
- name: Fail workflow if README.md needs updating
79+
- name: Fail workflow if files need updating
8080
if: steps.check-diff.outputs.status == 'failure'
8181
run: |
82-
echo "❌ README.md needs to be updated. Please run 'node update-readme.js' locally and commit the changes."
82+
echo "❌ Generated files need to be updated. Please run 'node update-readme.js' locally and commit the changes."
8383
exit 1

0 commit comments

Comments
 (0)