2.5 KiB
2.5 KiB
| description |
|---|
| Push the current branch to the remote with branch protection checks and OpenProject integration. |
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Outline
- Resolve remote URL: Run
git remote get-url originto get the remote URL. All commit and branch references in this skill MUST use the remote URL (e.g.,<remote-url>/commit/<hash>,<remote-url>/src/branch/<name>). Never use bare hashes or local-only references. - Check the current branch name with
git branch --show-current. - If the branch is
mainormaster, do NOT push. Instead:- Warn the user that this is a protected branch.
- Suggest creating a new branch using one of these conventions based on the changes:
feat/<short-description>— for new featuresfix/<short-description>— for bug fixesdocs/<short-description>— for documentation changesrefactor/<short-description>— for refactoringbuild/<short-description>— for build/infra changestest/<short-description>— for test additions or fixeschore/<short-description>— for miscellaneous changes
- Let the user decide the next action. Do NOT create the branch or push automatically.
- OpenProject sync (BEFORE pushing):
- Run
/speckit.updateOPto ensure OpenProject work packages are in sync with current specs/tasks. - After sync completes, identify the relevant OpenProject work package for the current branch/feature (milestone or phase WP).
- Run
git log --oneline origin/HEAD..HEAD(or equivalent) to get the commits about to be pushed. - For each commit, construct a link using the remote URL resolved in step 1:
<remote-url>/commit/<hash> - Add a comment to the relevant OpenProject work package via
mcp__openproject__add_work_package_commentwith:- Commit hash(es) as Gitea links
- Brief summary of what is being pushed
- If no relevant work package can be identified, warn the user and ask whether to proceed without logging.
- Run
- If the branch is not protected, run
git push(with-u origin <branch>if no upstream is set). - If the push succeeds, report success to the user including the OpenProject sync and comment logged.
- If the push fails due to a git hook or any other error:
- Summarize the error clearly and concisely for the user.
- Do NOT attempt to fix the issue, amend commits, or re-push.
- Let the user decide the next action.