wp-git-action
Woodpecker CI plugin to perform git actions.
steps:
- name: commit changelog
image: quay.io/thegeeklab/wp-git-action
settings:
action:
- commit
- push
netrc_password: ghp_randomstring
author_name: octobot
author_email: octobot@example.com
message: "[skip ci] update changelog"
-
Git action to execute.
Supported actions:
clone | commit | push | pages
. Specified actions are executed in the specified order- clone: Clones the repository in
remote_url
and checks out thebranch
topath
. - commit: Adds a commit to the default repository or the repository in
remote_url
. - push: Pushes all commits to the default repository or the repository set in
remote_url
. - pages: The
pages
action is a special action that cannot be combined with other actions. It is intended for use for GitHub pages. It synchronizes the contents ofpages_directory
with the targetbranch
usingrsync
and pushes the changes automatically.
Default: none - clone: Clones the repository in
-
Git author email.Default: none
-
Git author name.Default: none
-
Name of the git source branch.Default: main
-
Allow empty commits.
Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and those commits are not allowed by default.
Default: false -
Follow tags for pushes to remote repository.
Push all the
refs
that would be pushed without this option, and also push annotated tags inrefs/tags
that are missing from the remote.Default: false -
Enable force push to remote repository.Default: false
-
Skip SSL verification.
Activating this option is insecure and should be avoided in most cases.
Default: false -
Plugin log level.Default: info
-
Commit message.Default: [skip ci] commit dirty state
-
Netrc remote machine name.Default: github.com
-
Netrc login password on the remote machine.Default: none
-
Netrc login user on the remote machine.Default: token
-
Bypass the pre-commit and commit-msg hooks.Default: false
-
Add delete flag to pages rsync command.
When set to
true
, the--delete
flag is added to the rsync command to remove files from the branch that do not exist in thepages_directory
either.Default: true -
Source directory to be synchronized with the pages branch.Default: docs/
-
Files or directories to exclude from the pages rsync command.Default: none
-
Path to clone git repository.Default: none
-
Url of the remote repository.Default: none
-
Ssh private key for the remote repository.Default: none
The plugin can be used to publish GitHub pages to the pages branch. Remember that the pages
action cannot be combined with other actions.
steps:
- name: publish
image: quay.io/thegeeklab/wp-git-action
settings:
action:
- pages
author_email: bot@texample.com
author_name: octocat-bot
message: "update pages"
branch: gh-pages
pages_directory: docs/
netrc_password: ghp_randomstring
Build the binary with the following command:
make build
Build the Container image with the following command:
docker build --file Containerfile.multiarch --tag thegeeklab/wp-git-action .
docker run --rm \
-e PLUGIN_ACTION=clone \
-e PLUGIN_BRANCH=master \
-e PLUGIN_AUTHOR_EMAIL=octocat@example.copm \
-e PLUGIN_AUTHOR_NAME=octocat \
-e PLUGIN_REMOTE_URL=https://github.com/octocat/Hello-World \
-w /tmp \
thegeeklab/wp-git-action