From 7f33afc32bb0fcaae8d449a85b253238ec041850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?oliver=20k=C3=B6nig?= Date: Fri, 20 Dec 2024 00:16:00 +0100 Subject: [PATCH] ci: Run on `main` (#464) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: oliver könig --- .github/workflows/cicd-main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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' }}