diff --git a/.github/workflows/test-CI.yml b/.github/workflows/test-CI.yml index 58c7c295..fdc87801 100644 --- a/.github/workflows/test-CI.yml +++ b/.github/workflows/test-CI.yml @@ -33,10 +33,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Print repository name - run: | - echo "Repository Name: ${{ github.repository }}" - # Check out the branch from the pull request, whether it's from a fork or not - name: Checkout the target branch # logic step run: | @@ -46,7 +42,8 @@ jobs: git status if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then echo "We're in pull_request_target" - target_branch="${{ github.event.pull_request.base.ref }}" # from old config + echo "SHOULD_TEST_ALL_FILES=false" >> $GITHUB_ENV + target_branch="${{ github.event.pull_request.base.ref }}" if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then echo "PR from a fork detected. Checking out the fork's branch." # Checking out the fork's branch while still being in Classiq/classiq-library repo @@ -62,11 +59,13 @@ jobs: # `actions/checkout` will checkout to the branch that you chose in the `dispatch` tab - so we do nothing echo "we're in the right branch. no need to checkout (dispatch)" target_branch="${{ github.ref_name }}" # from old config - echo $target_branch # from old config + echo $target_branch + echo "SHOULD_TEST_ALL_FILES=true" >> $GITHUB_ENV + echo "list_of_ipynb_changed=**/*.ipynb" >> $GITHUB_ENV elif [[ "${{ github.event_name }}" == "push" ]]; then # we believe that `actions/checkout` will checkout to the branch that we push into (i.e. either `dev` or `main`) echo "we're in the right branch. no need to checkout (push)" - target_branch="$(gh pr view --json baseRefName,headRefName --jq .baseRefName)" # from old config + target_branch="$(gh pr view --json baseRefName,headRefName --jq .baseRefName)" else echo "we're not in push/pull/dispatch. error." exit 1 @@ -74,7 +73,6 @@ jobs: # debug echo "==== after" git status - echo "Repository Name: ${{ github.repository }}" # Debug - intresting when PR is from a fork - name: Set up Python uses: actions/setup-python@v5 @@ -120,17 +118,6 @@ jobs: run: | echo "Changed notebook files: ${{ steps.changed-files-ipynb.outputs.all_changed_files }}" - - name: Set changed notebook into environment variables # Could be integrated in logic step - run: | - set -ex - if [ "${{ github.event_name }}" == 'pull_request_target' ]; then - echo "SHOULD_TEST_ALL_FILES=false" >> $GITHUB_ENV - echo "list_of_ipynb_changed=${{ steps.changed-files-ipynb.outputs.all_changed_files }}" >> $GITHUB_ENV - elif [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then - echo "SHOULD_TEST_ALL_FILES=true" >> $GITHUB_ENV - echo "list_of_ipynb_changed=**/*.ipynb" >> $GITHUB_ENV - fi - - name: Install dependencies run: | set -e