-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor action.yml for template synchronization #16
Conversation
Updated action.yml to improve clarity and functionality, including changes to input descriptions, branch defaults, and steps for syncing templates.
Refactor test-action.sh script for improved clarity and structure, including changes to variable names, comments, and echo statements.
Add check and installation for uv/uvx in test script
|
@copilot Help to fix the broken test |
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
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.
Pull request overview
This pull request refactors the template synchronization action from a manual git-based implementation to use the rhiza tool, significantly simplifying the codebase while introducing several breaking changes to the API.
Key Changes:
- Replaced manual git sparse checkout logic with
uvx rhiza validateanduvx rhiza materializecommands - Removed several inputs:
automerge,test-mode, andtemplate-ref, replacing them with a singlecreate-prboolean input - Changed the default branch name from
sync/updatetosync/template-update
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| action.yml | Complete refactoring to use rhiza tool; removed configuration parsing logic, sparse checkout steps, and automerge functionality; simplified to 3 main steps (checkout, validate, sync+commit) |
| tests/test-action.sh | Rewrote test script to mirror the new rhiza-based workflow; removed automerge and YAML parsing tests; added direct rhiza command testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| create-pr: | ||
| description: Whether to create a pull request if changes are detected | ||
| required: false | ||
| default: "true" |
Copilot
AI
Dec 17, 2025
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.
The 'template-ref' input has been removed. This prevents users from specifying a specific tag or branch to check out from the template repository, limiting flexibility in template version control.
| fetch-depth: 0 | ||
| sparse-checkout: ${{ steps.config.outputs.include }} | ||
| sparse-checkout-cone-mode: false | ||
| version: "0.9.17" |
Copilot
AI
Dec 17, 2025
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.
The hardcoded version "0.9.17" for the uv tool should ideally be configurable or use a more flexible version constraint (e.g., "latest" or a version range). This makes it easier to keep dependencies up to date without requiring action updates.
| git push origin "HEAD:${{ inputs.branch }}" --force-with-lease | ||
Copilot
AI
Dec 17, 2025
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.
The action now always performs a git push even when create-pr is false. If a user sets create-pr to false but still wants to sync locally without pushing, they have no option. Consider making the push conditional based on whether create-pr is true, or adding a separate input to control pushing.
| git push origin "HEAD:${{ inputs.branch }}" --force-with-lease | |
| if [ "${{ inputs.create-pr }}" = "true" ]; then | |
| git push origin "HEAD:${{ inputs.branch }}" --force-with-lease | |
| fi |
| commit-message: ${{ inputs.commit-message }} | ||
| delete-branch: false | ||
| title: "chore: sync template from ${{ steps.config.outputs.template_repository }}@${{ steps.config.outputs.template_ref || steps.config.outputs.template_branch }}" | ||
| title: ${{ inputs.commit-message }} |
Copilot
AI
Dec 17, 2025
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.
The commit-message input is being used as the PR title. This may not be ideal as commit messages and PR titles often have different conventions and purposes. Consider using a separate input for the PR title or constructing a more descriptive title.
| if git diff --cached --name-only | grep -q '^\.github/workflows/'; then | ||
| echo "⚠️ Workflow files modified — PAT with workflow scope required." | ||
| echo "⚠️ Workflow files modified — PAT with workflow scope may be required." |
Copilot
AI
Dec 17, 2025
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.
The error message change from "PAT with workflow scope required" to "PAT with workflow scope may be required" is less definitive. If workflow files are being modified, the PAT definitely requires workflow scope, not just "may" require it. Consider reverting to the more accurate original message.
| echo "⚠️ Workflow files modified — PAT with workflow scope may be required." | |
| echo "⚠️ Workflow files modified — PAT with workflow scope required." |
| default: 'sync/update' | ||
| description: Target branch for the sync | ||
| required: false | ||
| default: sync/template-update |
Copilot
AI
Dec 17, 2025
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.
The default branch name has been changed from 'sync/update' to 'sync/template-update'. This is a breaking change that could affect existing workflows or automation that depend on the previous default branch name.
| default: sync/template-update | |
| default: sync/update |
| create-pr: | ||
| description: Whether to create a pull request if changes are detected | ||
| required: false | ||
| default: "true" |
Copilot
AI
Dec 17, 2025
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.
The 'automerge' input has been removed without providing an alternative mechanism or migration path. Users who were relying on the automerge feature will lose this functionality.
| create-pr: | ||
| description: Whether to create a pull request if changes are detected | ||
| required: false | ||
| default: "true" |
Copilot
AI
Dec 17, 2025
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.
The 'test-mode' input has been removed. This makes it harder to test the action without creating actual commits and pushes, which could complicate local testing and CI workflows.
…efault Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Simplify action.yml to use rhiza's default .github/template.yml convention
|
@copilot: please help with the broken test |
Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Fix test script to use file:// protocol for local Git repository
|
@copilot: Still tests file, see 2025-12-17 14:07:20.724 | INFO | rhiza.commands.materialize:materialize:72 - Include paths: |
* Initial plan * Simplify test to use real GitHub repository (jebel-quant/rhiza) Co-authored-by: tschm <2046079+tschm@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tschm <2046079+tschm@users.noreply.github.com>
Comment out the cloning of the jebel-quant/rhiza repository and related commands.
Updated action.yml to improve clarity and functionality, including changes to input descriptions, branch defaults, and steps for syncing templates.