-
Notifications
You must be signed in to change notification settings - Fork 87
ci: fix semantic release skipped due to head conflict #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe generate-llm-txt workflow is converted into a reusable workflow triggered via workflow_call. The semantic-release workflow now supports manual triggers, adds a job that calls the reusable generate-llm-txt workflow with inherited secrets, and updates the release job to depend on it. The checkout step gains fetch-depth and credential settings. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions
participant SR as Workflow: semantic-release.yml
participant T as Job: test
participant U as Job: update-llm-txt (reusable)
participant G as Reusable: generate-llm-txt.yml
participant R as Job: release
Dev->>GH: push to main or manual workflow_dispatch
GH->>SR: Start semantic-release workflow
SR->>T: Run tests
Note over T: Existing test execution
T-->>SR: Success/Failure
alt Tests succeed
SR->>U: Start update-llm-txt
U->>G: workflow_call (secrets: inherit)
G-->>U: Generate LLM.txt completed
U-->>SR: Success
SR->>R: Run release (needs: test, update-llm-txt)
R-->>SR: Release result
else Tests fail
SR-->>GH: Stop (release/update-llm-txt not executed)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/generate-llm-txt.yml (1)
21-26: Fix detached HEAD push: ensure checkout tracks the branch and push to an explicit refAs written, checkout defaults to a detached HEAD and
git pushwithout an upstream will fail or behave inconsistently. Check out the branch ref and push explicitly to it.Apply:
uses: actions/checkout@v4 with: token: ${{ steps.generate_token.outputs.token }} fetch-depth: 0 + ref: ${{ github.ref }} @@ - git push + git push origin HEAD:${{ github.ref_name }}Also applies to: 50-57
.github/workflows/semantic-release.yml (1)
35-41: Checkout the branch ref so release sees the llm.txt commit pushed by the prerequisite jobWithout checking out the branch ref, the workspace may be on the event SHA (stale) and semantic-release can skip due to a head change.
- name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false + ref: ${{ github.ref }}
🧹 Nitpick comments (6)
.github/workflows/generate-llm-txt.yml (3)
58-59: Remove unused GITHUB_TOKEN env (credentials already persisted by checkout)
actions/checkoutwithtokenpersists credentials; theGITHUB_TOKENenv here is redundant.- env: - GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + # No env needed; checkout already configured auth for push.
1-6: Add concurrency to avoid overlapping llm.txt updates on the same branchPrevents races if multiple runs target the same ref.
name: Generate LLM.txt on: workflow_call: +concurrency: + group: generate-llm-txt-${{ github.ref }} + cancel-in-progress: false
56-56: Commit author identity: use the App’s bot identity for clearer provenanceSet a consistent bot identity to match the app token.
- git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]".github/workflows/semantic-release.yml (3)
42-48: Token providers differ across jobs; consider standardizingYou use
actions/create-github-app-token@v1in the generator andtibdex/github-app-token@v2here. Both work, but standardizing simplifies maintenance.
1-11: Optional: add workflow-level concurrency to avoid parallel release runs on mainHelps prevent interleaved runs if multiple pushes land in quick succession.
name: Semantic Release on: push: branches: - main paths: - 'src/mcpm/**' - 'pyproject.toml' workflow_dispatch: +concurrency: + group: semantic-release-${{ github.ref }} + cancel-in-progress: true
1-11: Note: “[skip ci]” isn’t universally honored by GitHub ActionsIf other workflows still trigger on the LLM.txt push, add
paths-ignore: ['llm.txt']to their triggers instead of relying on commit message keywords.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/generate-llm-txt.yml(1 hunks).github/workflows/semantic-release.yml(1 hunks)
🔇 Additional comments (2)
.github/workflows/semantic-release.yml (2)
18-23: Good reuse: calling the generator via workflow_call with inherited secretsThis cleanly centralizes LLM.txt generation and orders it before release. LGTM.
12-17: Permissions look correct for releases and PyPI OIDC
contents,issues,pull-requests, andid-tokenare set appropriately. No changes needed.
|
🎉 This PR is included in version 2.8.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
User description
PR Type
Other
Description
Convert LLM.txt generation from standalone to reusable workflow
Add LLM.txt update as dependency in semantic release
Remove manual triggers from LLM.txt workflow
Ensure proper workflow sequencing for releases
Diagram Walkthrough
File Walkthrough
generate-llm-txt.yml
Convert to reusable workflow call.github/workflows/generate-llm-txt.yml
workflow_calltriggersemantic-release.yml
Add LLM.txt dependency to release workflow.github/workflows/semantic-release.yml
update-llm-txtjob that calls LLM.txt workflowSummary by CodeRabbit