From a348b720b3264ea2f728aa82634674e37f9b1af1 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Fri, 12 Jun 2026 17:28:08 -0600 Subject: [PATCH 1/2] Making the logging much more clear when this fails --- .github/workflows/pr-test-build.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-test-build.yml b/.github/workflows/pr-test-build.yml index 4ee04b614f..3a12b5acc8 100644 --- a/.github/workflows/pr-test-build.yml +++ b/.github/workflows/pr-test-build.yml @@ -16,20 +16,23 @@ jobs: - name: Checkout sources uses: actions/checkout@v5 - - name: Ensure our node version matches the main repo's version + - name: Ensure our node version matches the main repo's version for pull requests if: github.event_name == 'pull_request' run: | - [[ "$(curl -s https://raw.githubusercontent.com/opencast/opencast/refs/heads/${{ github.base_ref }}/pom.xml | \ - grep node.version | grep -Eo 'v[0-9.]+' | cut -f 1 -d '.' | cut -c 2-)" == "$NODE_VERSION" ]] \ + curl -s https://raw.githubusercontent.com/opencast/opencast/refs/heads/${{ github.base_ref }}/pom.xml -o pom.xml + export FOUND_VERSION="$(grep node.version pom.xml | grep -Eo 'v[0-9.]+' | cut -f 1 -d '.' | cut -c 2-)" + [[ "$FOUND_VERSION" == "$NODE_VERSION" ]] \ && exit 0 \ - || (echo "Node version does not match"; exit 1) - - name: Ensure our node version matches the main repo's version + || (echo "Node version does not match. Expected $NODE_VERSION, found $FOUND_VERSION"; exit 1) + + - name: Ensure our node version matches the main repo's version for push events if: github.event_name == 'push' run: | - [[ "$(curl -s https://raw.githubusercontent.com/opencast/opencast/refs/heads/${{ github.ref_name }}/pom.xml | \ - grep node.version | grep -Eo 'v[0-9.]+' | cut -f 1 -d '.' | cut -c 2-)" == "$NODE_VERSION" ]] \ + curl -s https://raw.githubusercontent.com/opencast/opencast/refs/heads/${{ github.ref_name }}/pom.xml -o pom.xml + export FOUND_VERSION="$(grep node.version pom.xml | grep -Eo 'v[0-9.]+' | cut -f 1 -d '.' | cut -c 2-)" + [[ "$FOUND_VERSION" == "$NODE_VERSION" ]] \ && exit 0 \ - || (echo "Node version does not match"; exit 1) + || (echo "Node version does not match. Expected $NODE_VERSION, found $FOUND_VERSION"; exit 1) - name: Get Node.js uses: actions/setup-node@v5 From 29e0b92dd7b0ff71de496c7dec21b7508019a810 Mon Sep 17 00:00:00 2001 From: Greg Logan Date: Fri, 12 Jun 2026 17:40:04 -0600 Subject: [PATCH 2/2] Only run this test on pushes matching an r/ or develop --- .github/workflows/pr-test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-test-build.yml b/.github/workflows/pr-test-build.yml index 3a12b5acc8..ed64dee037 100644 --- a/.github/workflows/pr-test-build.yml +++ b/.github/workflows/pr-test-build.yml @@ -26,7 +26,7 @@ jobs: || (echo "Node version does not match. Expected $NODE_VERSION, found $FOUND_VERSION"; exit 1) - name: Ensure our node version matches the main repo's version for push events - if: github.event_name == 'push' + if: github.event_name == 'push' && (startsWith("r/", github.ref_name) || "develop" == github.ref_name) run: | curl -s https://raw.githubusercontent.com/opencast/opencast/refs/heads/${{ github.ref_name }}/pom.xml -o pom.xml export FOUND_VERSION="$(grep node.version pom.xml | grep -Eo 'v[0-9.]+' | cut -f 1 -d '.' | cut -c 2-)"