360 Secure SkillHub
360 安全技能中心

auto-git

该 Skill 提供一个 Windows PowerShell 脚本,用于自动完成 Git 环境检查、创建提交、推送到远程分支,可选通过 GitHub CLI 创建仓库并输出部署提示;需要本地已安装 Git,使用建仓功能时还需 GitHub CLI 并已完成认证。

cruciata
cruciata
热度 67.03
最近更新 2026-05-11 17:29:59
分类:开发依赖:代码执行 / 第三方 API应用场景:DevOps / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add github-deploy-skill
Metadata
name
GitHub Deploy Skill
slug
github-deploy-skill
version
1.0.0
description
Commit and push local project changes to GitHub, with optional repo creation and deployment hints.
author
cruciata
tags
["latest","github","deploy","powershell"]

GitHub Deploy Skill

This skill provides a reusable PowerShell script for Windows to automate:

  1. Git checks
  2. Commit creation
  3. Push to remote branch
  4. Optional GitHub repository creation (via GitHub CLI)
  5. Optional deployment hints (for Streamlit flow)

Included file

  • github-deploy-skill.ps1

Parameters

  • -CommitMessage (required): commit message text
  • -Repo (optional): GitHub repository in owner/repo format
  • -Branch (optional): target branch, default main
  • -CreateRepo (optional switch): create repo with gh if missing
  • -SkipDeployHint (optional switch): do not print deployment hint

Usage

From any Git project folder:

powershell -ExecutionPolicy Bypass -File .\github-deploy-skill.ps1 -CommitMessage "feat: update" -Repo "owner/repo" -Branch "main"

Create repository automatically:

powershell -ExecutionPolicy Bypass -File .\github-deploy-skill.ps1 -CommitMessage "init" -Repo "owner/new-repo" -CreateRepo

Expected output

  • Success: commit and push completed
  • Failure: explicit error with reason (missing command, auth, push/network, remote config)

Requirements

  • Git installed and available in PATH
  • Network access to remote Git host
  • If -CreateRepo is used: GitHub CLI (gh) installed and authenticated

Notes

  • Works with repositories that do not yet have a first commit.
  • If origin does not exist, pass -Repo and the script will add it automatically.