drone-git-push

command module
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

drone-git-push

繁體中文 | 简体中文

GoDoc Lint and Testing Trivy Security Scan codecov Docker Pulls

A CI/CD plugin for Drone, Woodpecker, Crow CI, GitHub Actions, and Gitea Actions to push changes to a remote Git repository.

Table of Contents

Features

  • Push commits to remote repositories via SSH or HTTPS
  • Mirror all refs to a remote repository
  • Auto-commit dirty changes before pushing
  • Tag support with follow-tags option
  • Rebase before push
  • Force push support
  • Custom commit messages
  • Empty commit support
  • Git LFS support

Supported Platforms

CI Platform Status
Drone Fully supported
Woodpecker Fully supported
GitHub Actions Fully supported
Gitea Actions Fully supported

Usage

Drone / Woodpecker

Basic push to a remote branch:

- name: push commit
  image: appleboy/drone-git-push
  settings:
    branch: master
    remote: git@github.com:foo/bar.git
    ssh_key:
      from_secret: deploy_key

Push with commit changes:

- name: push commit
  image: appleboy/drone-git-push
  settings:
    branch: master
    remote: git@github.com:foo/bar.git
    force: false
    commit: true
    commit_message: "[skip ci] Update generated files"
    ssh_key:
      from_secret: deploy_key

Push to the current repository:

- name: push commit
  image: appleboy/drone-git-push
  settings:
    remote_name: origin
    branch: gh-pages
    local_ref: gh-pages

Mirror all refs to a remote repository:

- name: mirror push
  image: appleboy/drone-git-push
  settings:
    remote: git@github.com:foo/bar-mirror.git
    mirror: true
    ssh_key:
      from_secret: deploy_key

Push with tagging:

- name: push with tag
  image: appleboy/drone-git-push
  settings:
    branch: master
    remote: git@github.com:foo/bar.git
    commit: true
    tag: v1.0.0
    followtags: true
    ssh_key:
      from_secret: deploy_key
GitHub Actions
- name: Push changes
  uses: appleboy/drone-git-push@master
  with:
    remote: git@github.com:foo/bar.git
    branch: master
    ssh_key: ${{ secrets.DEPLOY_KEY }}
Gitea Actions
- name: Push changes
  uses: appleboy/drone-git-push@master
  with:
    remote: git@gitea.com:foo/bar.git
    branch: master
    ssh_key: ${{ secrets.DEPLOY_KEY }}

Parameter Reference

Parameter Description Default
ssh_key Private SSH key for the remote machine -
remote Target remote repository URL -
remote_name Name of the remote to use locally deploy
branch Target remote branch master
local_branch Local branch or ref to push HEAD
path Path to git repository Current directory
force Force push using --force flag false
skip_verify Skip verification of HTTPS certs false
commit Add and commit the contents before pushing false
commit_message Custom commit message [skip ci] Commit dirty state
empty_commit Create an empty commit false
no_verify Bypass pre-commit and commit-msg hooks false
tag Tag to add to the commit -
followtags Push with --follow-tags option false
rebase Pull --rebase before pushing false
mirror Push all refs with --mirror false
author_name Author name for the commit CI commit author
author_email Author email for the commit CI commit author email

Authentication

SSH Key

Provide a private SSH key for authentication:

settings:
  ssh_key:
    from_secret: deploy_key
HTTPS with Username/Password

Use netrc credentials for HTTPS authentication:

settings:
  username:
    from_secret: git_username
  password:
    from_secret: git_password

Build from Source

Build the binary:

go build
go test

Build Docker image:

# Build for Linux amd64
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-git-push

# Build Docker image
docker build --rm -t appleboy/drone-git-push -f docker/Dockerfile .

Run with Docker

docker run --rm \
  -e DRONE_COMMIT_AUTHOR=Octocat \
  -e DRONE_COMMIT_AUTHOR_EMAIL=octocat@github.com \
  -e PLUGIN_SSH_KEY="$(cat "${HOME}/.ssh/id_rsa")" \
  -e PLUGIN_BRANCH=master \
  -e PLUGIN_REMOTE=git@github.com:foo/bar.git \
  -e PLUGIN_FORCE=false \
  -v "$(pwd):$(pwd)" \
  -w "$(pwd)" \
  appleboy/drone-git-push

License

MIT License - see the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL