Skip to content

fix: checkout main branch for docs deployment on release#326

Merged
driessamyn merged 1 commit into
mainfrom
fix/docs-deploy-release-ref
Mar 28, 2026
Merged

fix: checkout main branch for docs deployment on release#326
driessamyn merged 1 commit into
mainfrom
fix/docs-deploy-release-ref

Conversation

@driessamyn

@driessamyn driessamyn commented Mar 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix docs deployment failing on release events (e.g. v2.0.0)
  • Always checkout main for the docs build, since release events use the tag ref which is rejected by the github-pages environment branch protection rules

Context

The v2.0.0 docs deployment failed because the release event checked out the 2.0.0 tag ref, which the github-pages environment protection rules don't allow. Docs should always be built from main.

Test plan

  • Merge and re-run the failed docs deployment for v2.0.0

Summary by CodeRabbit

  • Chores
    • Updated continuous integration workflow configuration to ensure consistent branch checkout behavior during automated processes, maintaining full git history retention for proper version tracking and reproducibility across pipeline executions.

Release events use the tag ref (e.g. 2.0.0) which is rejected by the
github-pages environment branch protection rules. Always checkout main
to ensure docs are deployed from the default branch.
@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Updated the GitHub Actions workflow configuration in the documentation build pipeline to explicitly specify checkout of the main branch while preserving the full Git history fetch depth setting.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/docs.yml
Added ref: main parameter to the actions/checkout step to enforce main branch checkout while maintaining fetch-depth: 0 for full history.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰✨ A whisker-twitch and one line grows,
The main branch checkout now surely flows,
Git history deep, from root to tip,
Our docs workflow perfects its grip!
With "ref: main" the path is clear. 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing docs deployment by ensuring the workflow checks out the main branch during release events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/docs-deploy-release-ref

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/docs.yml:
- Line 27: Replace the hardcoded "ref: main" in the checkout step with an
event-aware expression so pull_request builds use the PR branch and
release/workflow_dispatch use main; update the checkout ref to use the pull
request head when github.event_name == 'pull_request' (e.g. use "${{
github.event.pull_request.head.ref }}" or a conditional like "${{
github.event_name == 'pull_request' && github.event.pull_request.head.ref ||
'main' }}" so the checkout action uses the triggering ref for PRs and main for
release/workflow_dispatch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc18c241-e9bb-42e8-a72f-a8aee037707a

📥 Commits

Reviewing files that changed from the base of the PR and between c62a51f and a45b3df.

📒 Files selected for processing (1)
  • .github/workflows/docs.yml

- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
with:
ref: main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/docs.yml

Repository: driessamyn/kapper

Length of output: 2603


Use event-aware checkout ref to validate PR changes

Hardcoding ref: main on line 27 forces pull_request builds to use main branch code instead of the PR branch, preventing validation of PR changes to docs/, core/src/, or coroutines/src/. For release and workflow_dispatch events, main is the correct source; for pull_request, use the triggering ref.

Suggested patch
       - name: Checkout
         uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
         with:
-          ref: main
+          ref: ${{ github.event_name == 'release' && 'refs/heads/main' || github.ref }}
           fetch-depth: 0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ref: main
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
with:
ref: ${{ github.event_name == 'release' && 'refs/heads/main' || github.ref }}
fetch-depth: 0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docs.yml at line 27, Replace the hardcoded "ref: main" in
the checkout step with an event-aware expression so pull_request builds use the
PR branch and release/workflow_dispatch use main; update the checkout ref to use
the pull request head when github.event_name == 'pull_request' (e.g. use "${{
github.event.pull_request.head.ref }}" or a conditional like "${{
github.event_name == 'pull_request' && github.event.pull_request.head.ref ||
'main' }}" so the checkout action uses the triggering ref for PRs and main for
release/workflow_dispatch.

@github-actions

Copy link
Copy Markdown

Unit Tests

 62 files  ±0   62 suites  ±0   2m 59s ⏱️ ±0s
562 tests ±0  562 ✅ ±0  0 💤 ±0  0 ❌ ±0 
578 runs  ±0  578 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a45b3df. ± Comparison against base commit c62a51f.

This pull request removes 39 and adds 39 tests. Note that renamed tests count towards both.
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [10] LONGVARCHAR, "LONGVARCHAR", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1130/0x00007f42e4580880@2874fe6
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [11] NCHAR, "NCHAR", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1131/0x00007f42e4580aa0@1a4385d5
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [12] INSTANT, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$972/0x00007f42e4543b28@d38d3a9
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [12] NCLOB, "NCLOB", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1132/0x00007f42e4580cc0@62c57692
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [13] DATE, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$973/0x00007f42e4543d48@46b64e11
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [13] NVARCHAR, "NVARCHAR", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1133/0x00007f42e4580ee0@b584172
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [14] LOCALDATE, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$974/0x00007f42e4542800@46cc8b4f
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [14] ROWID, "ROWID", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1134/0x00007f42e4581100@28f35984
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [15] LOCALDATETIME, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$975/0x00007f42e4542a20@5fc9630a
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [15] SQLXML, "SQLXML", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1135/0x00007f42e4581320@23a2eb4b
…
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [10] LONGVARCHAR, "LONGVARCHAR", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1116/0x00007f5118568880@1fe2691f
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [11] NCHAR, "NCHAR", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1117/0x00007f5118568aa0@5deb88c5
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [12] INSTANT, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$957/0x00007f5118536398@75f75761
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [12] NCLOB, "NCLOB", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1118/0x00007f5118568cc0@14a625d0
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [13] DATE, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$958/0x00007f51185365b8@3d9f9b0a
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [13] NVARCHAR, "NVARCHAR", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1119/0x00007f5118568ee0@8cc2ffe
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [14] LOCALDATE, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$959/0x00007f51185367d8@34330239
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [14] ROWID, "ROWID", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1120/0x00007f5118569100@10b9d8a1
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [15] LOCALDATETIME, net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$961/0x00007f5118536c20@7d831b1c
net.samyn.kapper.internal.automapper.SQLTypesConverterTest ‑ [15] SQLXML, "SQLXML", net.samyn.kapper.internal.automapper.SQLTypesConverterTest$Companion$$Lambda$1121/0x00007f5118569320@3c8686b0
…

@github-actions

Copy link
Copy Markdown

POSTGRESQL Integration Tests

12 files  ±0  12 suites  ±0   25s ⏱️ +3s
55 tests ±0  55 ✅ ±0  0 💤 ±0  0 ❌ ±0 
85 runs  ±0  85 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a45b3df. ± Comparison against base commit c62a51f.

@github-actions

Copy link
Copy Markdown

SQLITE Integration Tests

12 files  ±0  12 suites  ±0   24s ⏱️ -1s
55 tests ±0  50 ✅ ±0  5 💤 ±0  0 ❌ ±0 
85 runs  ±0  80 ✅ ±0  5 💤 ±0  0 ❌ ±0 

Results for commit a45b3df. ± Comparison against base commit c62a51f.

@github-actions

Copy link
Copy Markdown

DUCKDB Integration Tests

12 files  ±0  12 suites  ±0   27s ⏱️ +3s
55 tests ±0  55 ✅ ±0  0 💤 ±0  0 ❌ ±0 
85 runs  ±0  85 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a45b3df. ± Comparison against base commit c62a51f.

@github-actions

Copy link
Copy Markdown

MYSQL Integration Tests

12 files  ±0  12 suites  ±0   44s ⏱️ -4s
55 tests ±0  46 ✅ ±0  9 💤 ±0  0 ❌ ±0 
85 runs  ±0  76 ✅ ±0  9 💤 ±0  0 ❌ ±0 

Results for commit a45b3df. ± Comparison against base commit c62a51f.

@github-actions

Copy link
Copy Markdown

MSSQLSERVER Integration Tests

12 files  ±0  12 suites  ±0   44s ⏱️ +2s
55 tests ±0  46 ✅ ±0  9 💤 ±0  0 ❌ ±0 
85 runs  ±0  76 ✅ ±0  9 💤 ±0  0 ❌ ±0 

Results for commit a45b3df. ± Comparison against base commit c62a51f.

@github-actions

Copy link
Copy Markdown

ORACLE Integration Tests

12 files  ±0  12 suites  ±0   1m 15s ⏱️ -1s
55 tests ±0  46 ✅ ±0  9 💤 ±0  0 ❌ ±0 
85 runs  ±0  76 ✅ ±0  9 💤 ±0  0 ❌ ±0 

Results for commit a45b3df. ± Comparison against base commit c62a51f.

@github-actions

Copy link
Copy Markdown

Code Coverage

Metric Coverage
Line N/A
Branch N/A
Instruction N/A

Updated for commit a45b3df

@driessamyn
driessamyn merged commit 1d8d836 into main Mar 28, 2026
19 checks passed
@driessamyn
driessamyn deleted the fix/docs-deploy-release-ref branch March 28, 2026 12:35
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant