Skip to content

Commit a63eea0

Browse files
authored
chore: simplify validate workflow (#15)
1 parent e3be3b9 commit a63eea0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

.github/workflows/validate.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ jobs:
1414
- name: Checkout repository
1515
uses: actions/checkout@v4
1616
with:
17-
# Needed to push changes back to the repo
18-
fetch-depth: 0
17+
fetch-depth: 2
1918

2019
# Must be done before setup-node.
2120
- name: Enable Corepack
@@ -36,11 +35,8 @@ jobs:
3635
id: find-json
3736
run: |
3837
# Get the list of added JSON files in the records/new/ directory
39-
ADDED_FILES=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} --diff-filter=A --name-only | grep '^records/new/.*\.json$' || true)
40-
echo "NEW_JSON_FILES=$ADDED_FILES" >> $GITHUB_ENV
41-
if [ -z "$ADDED_FILES" ]; then
42-
echo "No new JSON files found."
43-
fi
38+
ADDED_FILES=$(git diff HEAD^..HEAD --diff-filter=A --name-only records/new | grep '/.*\.json$' || true)
39+
echo "NEW_JSON_FILES=$ADDED_FILES" >> "$GITHUB_ENV"
4440
4541
- name: Validate files
4642
if: env.NEW_JSON_FILES

0 commit comments

Comments
 (0)