From 0494a3e6420c20cac3a91af57a8c1a4a02428d87 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Fri, 26 Sep 2025 21:36:14 +0200 Subject: [PATCH 1/3] github: fix self-hosted runner checkout issues The unified workflow had two critical issues with repository checkout on self-hosted runners. For pull requests, it attempted to fetch non-existent merge refs like "35/merge". For push events, it used incomplete HTTPS URLs missing the .git suffix. This fixes both by using proper GitHub PR refs (refs/pull/N/head) and complete HTTPS clone URLs with .git suffix for the public repository. Fixes: 1b740047 ("github: unify self-hosted runner workflows") Generated-by: Claude AI Signed-off-by: Daniel Gomez --- .github/workflows/kdevops.yml | 42 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/kdevops.yml b/.github/workflows/kdevops.yml index ac2ac6251..09db6505b 100644 --- a/.github/workflows/kdevops.yml +++ b/.github/workflows/kdevops.yml @@ -179,29 +179,27 @@ jobs: run: | set -euxo pipefail - # More efficient approach similar to actions/checkout - if [[ -d ".git" ]]; then - # Repo exists - clean and update (like actions/checkout) - git clean -ffdx - git reset --hard HEAD - # Ensure correct remote URL - git remote set-url origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY - git fetch --depth=1 origin ${{ github.ref_name }} - git reset --hard FETCH_HEAD + # Start fresh + rm -rfv ./* ./.* 2>/dev/null || true + + # Clone repository (with mirror optimization when available) + if [[ -f "/mirror/kdevops.git/HEAD" ]]; then + git clone --verbose --progress \ + --reference /mirror/kdevops.git \ + --depth=1 \ + ${{ github.server_url }}/${{ github.repository }}.git . else - # No repo - fresh clone with local mirror optimization - if [[ -f "/mirror/kdevops.git/HEAD" ]]; then - git clone --verbose --progress \ - --reference /mirror/kdevops.git \ - --depth=1 \ - --branch ${{ github.ref_name }} \ - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . - else - git clone --verbose --progress \ - --depth=1 \ - --branch ${{ github.ref_name }} \ - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . - fi + git clone --verbose --progress \ + --depth=1 \ + ${{ github.server_url }}/${{ github.repository }}.git . + fi + + # Checkout the appropriate ref based on event type + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + git fetch --depth=1 origin refs/pull/${{ github.event.number }}/head:pr-branch + git checkout pr-branch + else + git checkout ${{ github.sha }} fi - name: Configure kdevops From a2841f7d7512cd594c46e87aabe4d97c42c30955 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Fri, 26 Sep 2025 22:12:54 +0200 Subject: [PATCH 2/3] github: kdevops: add commit version reporting This displays the kdevops commit being used right after checkout instead of waiting until the end of the workflow. Users can now see which version is running right away for validation. Generated-by: Claude AI Signed-off-by: Daniel Gomez --- .github/workflows/kdevops.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/kdevops.yml b/.github/workflows/kdevops.yml index 09db6505b..a93ce1504 100644 --- a/.github/workflows/kdevops.yml +++ b/.github/workflows/kdevops.yml @@ -202,6 +202,23 @@ jobs: git checkout ${{ github.sha }} fi + - name: Report kdevops commit information + shell: bash + run: | + set -euxo pipefail + + # Get current commit info + commit_sha=$(git rev-parse HEAD) + commit_short=$(git rev-parse --short HEAD) + commit_subject=$(git log -1 --pretty=format:"%s") + + # Report the kdevops version used + echo "::notice title=kdevops Commit::Using kdevops commit $commit_short ($commit_sha): $commit_subject" + + # Also show in regular output for logs + echo "✅ Running kdevops CI with commit: $commit_short" + echo "📝 Commit message: $commit_subject" + - name: Configure kdevops uses: ./.github/actions/configure with: From 7f27881f604562a735f82d7905c42cc31bd8c751 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Fri, 26 Sep 2025 22:13:30 +0200 Subject: [PATCH 3/3] github: eliminate duplicate CI runs for branch pushes This prevents wasteful duplicate CI execution that occurred when pushing to a branch and creating a PR from it. Now only main branch pushes and PRs to main trigger CI, with ci-testing/* branches available for direct push-based workflow testing while blocking PRs from those branches. Generated-by: Claude AI Signed-off-by: Daniel Gomez --- .github/workflows/kdevops.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kdevops.yml b/.github/workflows/kdevops.yml index a93ce1504..60754ba75 100644 --- a/.github/workflows/kdevops.yml +++ b/.github/workflows/kdevops.yml @@ -7,10 +7,11 @@ on: - cron: '0 14 * * *' # Daily at 2 PM UTC push: branches: - - '**' + - main + - 'ci-testing/**' pull_request: branches: - - '**' + - main workflow_dispatch: inputs: ci_workflow: