From 5a2b78c1502d42bb3ca210566f2f04f750dcd351 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 1 Dec 2024 20:25:39 +0100 Subject: [PATCH 1/3] Fix corepack error --- .github/workflows/validate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 3d4ac43..9a9175f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -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: From 9f55268ce647493ac0031efecba05127009a8f5a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 1 Dec 2024 20:37:14 +0100 Subject: [PATCH 2/3] fixup! Fix corepack error --- .github/workflows/process.yml | 7 +++++++ .github/workflows/validate.yml | 3 +++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/process.yml b/.github/workflows/process.yml index c2a7342..a85c3c0 100644 --- a/.github/workflows/process.yml +++ b/.github/workflows/process.yml @@ -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: @@ -44,6 +48,9 @@ jobs: # 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$') 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 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 9a9175f..293533c 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -38,6 +38,9 @@ jobs: # 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$') 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 From 4c5d231347245a6fc8f7de242c058049722baba1 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 1 Dec 2024 20:42:45 +0100 Subject: [PATCH 3/3] fixup! fixup! Fix corepack error --- .github/workflows/process.yml | 2 +- .github/workflows/validate.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/process.yml b/.github/workflows/process.yml index a85c3c0..d811254 100644 --- a/.github/workflows/process.yml +++ b/.github/workflows/process.yml @@ -46,7 +46,7 @@ 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." diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 293533c..6a8e83d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -36,7 +36,7 @@ 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."