From 22c208b7aa6fdfef25f9058d11d7f02d55fc38da Mon Sep 17 00:00:00 2001 From: Jennifer Tran <12633533+botanical@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:53:24 -0800 Subject: [PATCH] feat: add new step to gracefully exit --- .github/workflows/pr.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 24434042..ef7f220f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -74,20 +74,22 @@ jobs: with: files: ingestion-data/staging/dataset-config/**.json - - name: List all newly added files and exit gracefully if none + - name: List all newly added files env: ADDED_FILES: ${{ steps.changed-files.outputs.added_files }} ADDED_FILES_COUNT: $${{ steps.changed-files.outputs.added_files_count}} run: | - if [ "$ADDED_FILES_COUNT" -eq 0 ]; then - echo "🕵️ No new files found. Exiting workflow." - exit 0 - fi for file in ${ADDED_FILES}; do echo "$file was added" done echo "added_files_count: ${ADDED_FILES_COUNT}" + - name: Exit early if no new files + if: ${{ steps.changed-files.outputs.added_files_count == 0 }} + run: | + echo "🕵️ No new files found. Exiting workflow early." + exit 0 + # Makes request to /dataset/publish endpoint # Outputs only files that were successfully published # Used by other steps