Add commit settings to Butane and git-sync (#71)

This PR adds commit settings to Butane's git-push action.
I did more testing, found out that `commit` is mandatory for pushing it to the remote repo after any changes, otherwise there won't be anything being pushed.

This is mainly my mistake for not testing it properly on the last [PR #66](https://codeberg.org/Codeberg-CI/examples/pulls/66).
Further more adds comments and options for using `drone-git-push`.

Best,

Reviewed-on: https://codeberg.org/Codeberg-CI/examples/pulls/71
Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org>
Co-authored-by: Colgrave <hanqixu@disroot.org>
Co-committed-by: Colgrave <hanqixu@disroot.org>
This commit is contained in:
Colgrave 2025-01-24 12:38:53 +00:00 committed by Patrick Schratz
parent 8c1ba9597f
commit efe721cf00
2 changed files with 15 additions and 1 deletions

View File

@ -19,9 +19,15 @@ steps:
- bash ./script.sh - bash ./script.sh
- name: push - name: push
# for more information about plugin settings, please refer to
# https://github.com/appleboy/drone-git-push/blob/master/DOCS.md
image: docker.io/appleboy/drone-git-push image: docker.io/appleboy/drone-git-push
settings: settings:
ssh_key: ssh_key:
from_secret: ssh_key from_secret: ssh_key
remote: git@codeberg.org:<YOUR_GIT_REPO>.git remote: git@codeberg.org:<YOUR_GIT_REPO>.git
branch: main branch: main
commit: true
# force: boolean, force push using the `--force` flag, defaults to false
# commit_message: add a custom message for commit, if it is omitted, it will be `[skip ci] Commit dirty state`
# empty_commit: boolean, if you only want generate an empty commit, you can do it using this option

View File

@ -1,6 +1,8 @@
# Git/.woodpecker.yaml # Git/.woodpecker.yaml
# #
# CI step to automatic synchronization with an upstream repository. # CI step to automatic synchronization with an upstream repository.
#
# [drone-git-push](https://github.com/appleboy/drone-git-push)
when: when:
event: [cron, manual] event: [cron, manual]
@ -16,9 +18,15 @@ steps:
- git merge upstream/main - git merge upstream/main
- name: push - name: push
# for more information about plugin settings, please refer to
# https://github.com/appleboy/drone-git-push/blob/master/DOCS.md
image: docker.io/appleboy/drone-git-push:latest image: docker.io/appleboy/drone-git-push:latest
settings: settings:
ssh_key: ssh_key:
from_secret: ssh_key from_secret: ssh_key
remote: git@codeberg.org:<YOUR_REPO> remote: git@codeberg.org:<YOUR_REPO>.git
branch: main branch: main
commit: true
# force: boolean, force push using the `--force` flag, defaults to false
# commit_message: add a custom message for commit, if it is omitted, it will be `[skip ci] Commit dirty state`
# empty_commit: boolean, if you only want generate an empty commit, you can do it using this option