This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 3d7358bc5458 CAMEL-23318: fix /component-test for fork PRs by using
refs/pull/N/head (#26274)
3d7358bc5458 is described below
commit 3d7358bc5458a909fad3b40cb3191ca6ec483643
Author: Guillaume Nodet <[email protected]>
AuthorDate: Mon Sep 14 05:08:52 2026 +0200
CAMEL-23318: fix /component-test for fork PRs by using refs/pull/N/head
(#26274)
---
.github/workflows/pr-build-main.yml | 4 ++--
.github/workflows/pr-manual-component-test.yml | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/pr-build-main.yml
b/.github/workflows/pr-build-main.yml
index e066df2a41ff..167109bc2c56 100644
--- a/.github/workflows/pr-build-main.yml
+++ b/.github/workflows/pr-build-main.yml
@@ -22,7 +22,7 @@ on:
branches:
- main
# CI-only changes don't need a full build. Use workflow_dispatch to
- # test CI changes: gh workflow run "Build and test" -f pr_number=XXXX -f
pr_ref=branch-name
+ # test CI changes: gh workflow run "Build and test" -f pr_number=XXXX -f
pr_ref=refs/pull/XXXX/head
paths-ignore:
- .claude-plugin/**
- .idea/**
@@ -41,7 +41,7 @@ on:
required: true
type: string
pr_ref:
- description: 'Git ref of the pull request branch'
+ description: 'Git ref of the pull request (e.g. refs/pull/XXXX/head)'
required: true
type: string
extra_modules:
diff --git a/.github/workflows/pr-manual-component-test.yml
b/.github/workflows/pr-manual-component-test.yml
index 4686f9fa3d17..429439c285ef 100644
--- a/.github/workflows/pr-manual-component-test.yml
+++ b/.github/workflows/pr-manual-component-test.yml
@@ -49,7 +49,6 @@ jobs:
run: |
pr="$(gh api /repos/${GH_REPO}/pulls/${PR_NUMBER})"
head_sha="$(echo "$pr" | jq -r .head.sha)"
- head_ref="$(echo "$pr" | jq -r .head.ref)"
# Check that the PR branch was not pushed to after the comment was
created.
commit="$(gh api /repos/${GH_REPO}/commits/${head_sha})"
committed_at="$(echo "$commit" | jq -r .commit.committer.date)"
@@ -58,7 +57,10 @@ jobs:
exit 1
fi
echo "pr_sha=$head_sha" >> $GITHUB_OUTPUT
- echo "pr_ref=$head_ref" >> $GITHUB_OUTPUT
+ # Use refs/pull/<N>/head so the ref is resolvable in apache/camel
for both
+ # same-repo and fork PRs (head.ref is the branch name in the fork,
which
+ # does not exist in the base repository).
+ echo "pr_ref=refs/pull/${PR_NUMBER}/head" >> $GITHUB_OUTPUT
- name: React to comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}