You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/06/14 10:29:07 UTC
(camel-website) branch fix/1650-skip-pr-builds-for-drafts created (now 9b9f1366)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch fix/1650-skip-pr-builds-for-drafts
in repository https://gitbox.apache.org/repos/asf/camel-website.git
at 9b9f1366 fix(#1650): skip PR builds when only draft blog posts changed
This branch includes the following new commits:
new 9b9f1366 fix(#1650): skip PR builds when only draft blog posts changed
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(camel-website) 01/01: fix(#1650): skip PR builds when only draft blog posts changed
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch fix/1650-skip-pr-builds-for-drafts
in repository https://gitbox.apache.org/repos/asf/camel-website.git
commit 9b9f1366ad818e48e086925d82f1062f6f8fcd41
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Jun 14 12:29:02 2026 +0200
fix(#1650): skip PR builds when only draft blog posts changed
Adds a detect-drafts job that checks if all changed files belong to
draft blog posts. If so, the full build/checks/preview pipeline is
skipped entirely.
Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
---
.github/workflows/pr.yaml | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
index 90c9841b..35ee6af2 100644
--- a/.github/workflows/pr.yaml
+++ b/.github/workflows/pr.yaml
@@ -28,7 +28,49 @@ env:
HUGO_OPTIONS: '--buildFuture'
jobs:
+ detect-drafts:
+ runs-on: ubuntu-latest
+ outputs:
+ drafts-only: ${{ steps.check.outputs.drafts-only }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v5
+ - name: Check if PR only changes draft blog posts
+ id: check
+ run: |
+ CHANGED=$(gh pr diff ${{ github.event.pull_request.number }} --name-only)
+ DRAFTS_ONLY=true
+ for file in $CHANGED; do
+ case "$file" in
+ content/blog/*/index.md)
+ if ! grep -q '^draft: true' "$file" 2>/dev/null; then
+ DRAFTS_ONLY=false
+ break
+ fi
+ ;;
+ content/blog/*)
+ # assets (images, SVGs) alongside a draft post are fine
+ dir=$(dirname "$file")
+ index="$dir/index.md"
+ if [ ! -f "$index" ] || ! grep -q '^draft: true' "$index" 2>/dev/null; then
+ DRAFTS_ONLY=false
+ break
+ fi
+ ;;
+ *)
+ DRAFTS_ONLY=false
+ break
+ ;;
+ esac
+ done
+ echo "drafts-only=$DRAFTS_ONLY" >> "$GITHUB_OUTPUT"
+ echo "Drafts only: $DRAFTS_ONLY"
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
checks:
+ needs: detect-drafts
+ if: needs.detect-drafts.outputs.drafts-only != 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout