From 5217da1691fbbb3a542f3d34393f34609a9fc849 Mon Sep 17 00:00:00 2001 From: aboudjem Date: Mon, 19 Feb 2024 02:18:31 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Update=20automation=5Fworkflow.y?= =?UTF-8?q?ml=20to=20check=20for=20changes=20in=20package.json=20and=20CHA?= =?UTF-8?q?NGELOG.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/automation_workflow.yml | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/automation_workflow.yml b/.github/workflows/automation_workflow.yml index 685efd09..81d3d6e3 100644 --- a/.github/workflows/automation_workflow.yml +++ b/.github/workflows/automation_workflow.yml @@ -13,16 +13,20 @@ jobs: runs-on: ubuntu-latest if: contains(github.head_ref, 'fix/') || contains(github.head_ref, 'release/') steps: - - uses: actions/checkout@v2 - - name: Check for versioning changes in package.json and CHANGELOG.md - run: | - git fetch --depth=1 origin +refs/heads/*:refs/remotes/origin/* - PACKAGE_CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} -- 'package.json') - CHANGELOG_CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} -- 'CHANGELOG.md') - if [[ -z "$PACKAGE_CHANGED" || -z "$CHANGELOG_CHANGED" ]]; then - echo "::error::package.json and CHANGELOG.md must be updated." - exit 1 - fi + - uses: actions/checkout@v2 + - uses: dorny/paths-filter@v2 + id: changes + with: + filters: | + package: + - 'package.json' + changelog: + - 'CHANGELOG.md' + - name: Fail if package.json or CHANGELOG.md are not updated + if: ${{ !steps.changes.outputs.package && !steps.changes.outputs.changelog }} + run: | + echo "package.json and CHANGELOG.md must be updated in this PR." + exit 1 auto-create-pr-to-dev-main: runs-on: ubuntu-latest