Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
# Needed to push changes back to the repo
fetch-depth: 0

# Must be done before setup-node.
- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -42,8 +46,11 @@ jobs:
id: find-json
run: |
# Get the list of added JSON files in the records/new/ directory
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$')
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)
echo "NEW_JSON_FILES=$ADDED_FILES" >> $GITHUB_ENV
if [ -z "$ADDED_FILES" ]; then
echo "No new JSON files found."
fi

- name: Process and move files
if: env.NEW_JSON_FILES
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
# Needed to push changes back to the repo
fetch-depth: 0

# Must be done before setup-node.
- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -32,8 +36,11 @@ jobs:
id: find-json
run: |
# Get the list of added JSON files in the records/new/ directory
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$')
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)
echo "NEW_JSON_FILES=$ADDED_FILES" >> $GITHUB_ENV
if [ -z "$ADDED_FILES" ]; then
echo "No new JSON files found."
fi

- name: Validate files
if: env.NEW_JSON_FILES
Expand Down