From e65cca28624330e8377bc64af3c0f15539335b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kautler?= Date: Wed, 19 Apr 2023 15:34:12 +0200 Subject: [PATCH] Improve all script consistency check --- .github/workflows/branches-and-prs.main.kts | 8 ++------ .github/workflows/branches-and-prs.yml | 7 ++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/branches-and-prs.main.kts b/.github/workflows/branches-and-prs.main.kts index abe2097023..08a500664d 100755 --- a/.github/workflows/branches-and-prs.main.kts +++ b/.github/workflows/branches-and-prs.main.kts @@ -67,12 +67,8 @@ workflow( action = CheckoutV3() ) run( - name = "Regenerate all workflow YAMLs", - command = """find .github/workflows -mindepth 1 -maxdepth 1 -name "*.main.kts" -exec sh -c {} \;""" - ) - run( - name = "Check if some file is different after regeneration", - command = "git diff --exit-code ." + name = "Regenerate all workflow YAMLs and check for modifications", + command = """find .github/workflows -mindepth 1 -maxdepth 1 -name "*.main.kts" | xargs -ri sh -c '{} && git diff --exit-code'""" ) } diff --git a/.github/workflows/branches-and-prs.yml b/.github/workflows/branches-and-prs.yml index b888f8b772..ae6f5b9538 100644 --- a/.github/workflows/branches-and-prs.yml +++ b/.github/workflows/branches-and-prs.yml @@ -38,11 +38,8 @@ jobs: name: Checkout Repository uses: actions/checkout@v3 - id: step-1 - name: Regenerate all workflow YAMLs - run: find .github/workflows -mindepth 1 -maxdepth 1 -name "*.main.kts" -exec sh -c {} \; - - id: step-2 - name: Check if some file is different after regeneration - run: git diff --exit-code . + name: Regenerate all workflow YAMLs and check for modifications + run: find .github/workflows -mindepth 1 -maxdepth 1 -name "*.main.kts" | xargs -ri sh -c '{} && git diff --exit-code' build-and-verify: name: Build and Verify runs-on: ${{ matrix.os }}