diff --git a/.github/workflows/cicd-main.yml b/.github/workflows/cicd-main.yml index 6f2ee3775..781d3b482 100644 --- a/.github/workflows/cicd-main.yml +++ b/.github/workflows/cicd-main.yml @@ -55,6 +55,7 @@ jobs: - name: Get changed files id: changed-files + if: github.event_name == 'pull_request' uses: tj-actions/changed-files@v44 with: files_yaml: | @@ -71,19 +72,19 @@ jobs: DOCS_ONLY: ${{ steps.changed-files.outputs.doc_any_changed == 'true' && steps.changed-files.outputs.src_any_changed == 'false' }} CHANGED_DOCS: ${{ steps.changed-files.outputs.doc_all_changed_files }} CHANGED_SRC: ${{ steps.changed-files.outputs.src_all_changed_files }} + IS_PULLREQUEST: ${{ github.event_name == 'pull_request' }} LABEL: ${{ github.event.label.name == 'Run CICD' }} - MAIN_BRANCH: ${{ github.ref == 'refs/heads/main' }} run: | # Some output that's helpful for debugging echo "Docs changed: $CHANGED_DOCS" echo "Src changed: $CHANGED_SRC" - echo "docs_only: $DOCS_ONLY" - echo "label: $LABEL" - echo "main_branch: $MAIN_BRANCH" + echo "DOCS_ONLY: $DOCS_ONLY" + echo "LABEL: $LABEL" + echo "IS_PULLREQUEST: $IS_PULLREQUEST" # Run CI only (on main or if label is attached) and if it's not only docs - echo run_ci=$([[ ("$LABEL" = "true" || "$MAIN_BRANCH" = "true") && "$DOCS_ONLY" = "false" ]] && echo "true" || echo "false") | tee -a "$GITHUB_OUTPUT" + echo run_ci=$([[ ("$LABEL" = "true" || "$IS_PULLREQUEST" = "false") && "$DOCS_ONLY" = "false" ]] && echo "true" || echo "false") | tee -a "$GITHUB_OUTPUT" build-container: if: ${{ needs.pre-flight.outputs.run_ci == 'true' }}