diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index 48b0f8fa26..01cb4bd967 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -70,6 +70,7 @@ jobs: uses: actions/checkout@v4 with: fetch-tags: true + - name: Get changed files in the client folder id: changed-files-specific uses: tj-actions/changed-files@v41 @@ -94,46 +95,6 @@ jobs: script: | await require("client-build-compliance.js")({core, github, context}) - - name: Get all the added or changed files in client/src folder - if: inputs.ads-compliant-check == 'true' && inputs.pr != 0 && github.pull_request.base.ref == 'release' && (steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') - id: client_files - uses: umani/changed-files@v4.1.0 - with: - repo-token: ${{ secrets.APPSMITH_CI_TEST_PAT }} - pattern: "app/client/src/.*" - pr-number: ${{ inputs.pr }} - - # Check all the newly added files are in ts - - name: ADS compliant check - if: inputs.ads-compliant-check == 'true' && inputs.pr != 0 && github.pull_request.base.ref == 'release' && (steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') - id: ads_check - run: | - comment_files="" - files=(${{steps.client_files.outputs.files_created}}${{steps.client_files.outputs.files_updated}}) - for file in "${files[@]}"; do - while IFS= read -r line; do - if echo "$line" | grep -q -E '(color|Color).*#|border.*#|(color|Color).*"'; then - comment_files+=("$file") - break - fi - done < ${file#app/client/} - done - unique_files=$(echo "${comment_files[@]}" | sort -u | sed '/^[[:space:]]*$/d' | sed 's/ /
  • /g') - echo "ads_non_compliant_files=$unique_files" >> $GITHUB_OUTPUT - echo "ads_non_compliant_count=${#unique_files[@]}" >> $GITHUB_OUTPUT - - # Comment in PR if test files are not written in ts and fail the workflow - - name: Comment in PR if test files are not written in ts - if: steps.ads_check.outputs.ads_non_compliant_count != 0 && inputs.ads-compliant-check == 'true' && inputs.pr != 0 && github.pull_request.base.ref == 'release' && (steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') - uses: peter-evans/create-or-update-comment@v3 - with: - issue-number: ${{ inputs.pr }} - body: | - 🔴 Below files are not compliant with ADS. Please fix and re-trigger ok-to-test -
      ${{steps.ads_check.outputs.ads_non_compliant_files}}
    - - if: steps.ads_check.outputs.ads_non_compliant_count != 0 && inputs.ads-compliant-check == 'true' && inputs.pr != 0 && github.pull_request.base.ref == 'release' - run: exit 1 - # In case this is second attempt try restoring status of the prior attempt from cache - name: Restore the previous run result if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'