mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2026-07-27 20:29:08 +02:00
* feat: add _run_hook helper and eight hook inputs * fix(_run_hook): default snippet to empty when arg unset * feat: wire add/commit hooks into _main * feat: wire tag and push hooks into _main * test: verify failing hook aborts the action * docs: document hooks system in README * test: tighten failing-hook assertion * docs(hooks): note set -eu semantics for snippet authors * refactor(hooks): rename action inputs to suffix with _hook * refactor(hooks): include _hook suffix in event identifier * docs(hooks): add notes about security implications of hooks
144 lines
4.9 KiB
YAML
144 lines
4.9 KiB
YAML
name: Git Auto Commit
|
|
description: 'Automatically commits files which have been changed during the workflow run and push changes back to remote repository.'
|
|
|
|
author: Stefan Zweifel <stefan@stefanzweifel.dev>
|
|
|
|
inputs:
|
|
commit_message:
|
|
description: Commit message
|
|
required: false
|
|
default: Apply automatic changes
|
|
branch:
|
|
description: Git branch name, where changes should be pushed too. Required if Action is used on the `pull_request` event
|
|
required: false
|
|
default: ${{ github.head_ref }}
|
|
commit_options:
|
|
description: Commit options (eg. --no-verify)
|
|
required: false
|
|
default: ''
|
|
add_options:
|
|
description: Add options (eg. -u)
|
|
required: false
|
|
default: ''
|
|
status_options:
|
|
description: Status options (eg. --untracked-files=no)
|
|
required: false
|
|
default: ''
|
|
file_pattern:
|
|
description: File pattern used for `git add` and the dirty-check (`git status`). Supports multiple space-separated patterns. For example `src/*.js`
|
|
required: false
|
|
default: '.'
|
|
repository:
|
|
description: Relative file path under $GITHUB_WORKSPACE to the git repository. Defaults to the current directory (`.`)
|
|
required: false
|
|
default: '.'
|
|
commit_user_name:
|
|
description: Name used for the commit user
|
|
required: false
|
|
default: github-actions[bot]
|
|
commit_user_email:
|
|
description: Email address used for the commit user
|
|
required: false
|
|
default: 41898282+github-actions[bot]@users.noreply.github.com
|
|
commit_author:
|
|
description: Value used for the commit author. Defaults to the username of whoever triggered this workflow run.
|
|
required: false
|
|
default: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
|
|
tag_name:
|
|
description: Tag name used for creating a new git tag with the commit. Keep this empty, if no tag should be created.
|
|
required: false
|
|
default: ''
|
|
tagging_message:
|
|
description: Tagging message used for creating a new git tag with the commit. Keep this empty, if no tag should be created.
|
|
required: false
|
|
default: ''
|
|
push_options:
|
|
description: Push options (eg. --force)
|
|
required: false
|
|
default: ''
|
|
skip_dirty_check:
|
|
description: Skip the check if the git repository is dirty and always try to create a commit.
|
|
required: false
|
|
default: false
|
|
skip_fetch:
|
|
description: Skip the call to git-fetch.
|
|
required: false
|
|
default: false
|
|
skip_checkout:
|
|
description: Skip the call to git-checkout.
|
|
required: false
|
|
default: false
|
|
skip_push:
|
|
description: Skip the call to git-push.
|
|
required: false
|
|
default: false
|
|
disable_globbing:
|
|
description: Stop the shell from expanding filenames (https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html)
|
|
required: false
|
|
default: false
|
|
create_branch:
|
|
description: Create new branch with the name of `branch`-input in local and remote repository, if it doesn't exist yet.
|
|
required: false
|
|
default: false
|
|
create_git_tag_only:
|
|
description: Perform a clean git tag and push, without commiting anything
|
|
required: false
|
|
default: false
|
|
before_add_hook:
|
|
description: Shell snippet to run before `git add`.
|
|
required: false
|
|
default: ''
|
|
after_add_hook:
|
|
description: Shell snippet to run after `git add`.
|
|
required: false
|
|
default: ''
|
|
before_commit_hook:
|
|
description: Shell snippet to run before `git commit`.
|
|
required: false
|
|
default: ''
|
|
after_commit_hook:
|
|
description: Shell snippet to run after `git commit`.
|
|
required: false
|
|
default: ''
|
|
before_tag_hook:
|
|
description: Shell snippet to run before `git tag` is created.
|
|
required: false
|
|
default: ''
|
|
after_tag_hook:
|
|
description: Shell snippet to run after `git tag` is created.
|
|
required: false
|
|
default: ''
|
|
before_push_hook:
|
|
description: Shell snippet to run before `git push`.
|
|
required: false
|
|
default: ''
|
|
after_push_hook:
|
|
description: Shell snippet to run after `git push`.
|
|
required: false
|
|
default: ''
|
|
disable_pull_request_target_trigger_warning:
|
|
description: Suppress the security warning emitted when the action runs on a `pull_request_target` event.
|
|
required: false
|
|
default: false
|
|
internal_git_binary:
|
|
description: Internal use only! Path to git binary used to check if git is available. (Don't change this!)
|
|
required: false
|
|
default: git
|
|
|
|
|
|
outputs:
|
|
changes_detected:
|
|
description: Value is "true" if matching changes were detected and committed. Value is "false" if no matching changes were detected or only CRLF changes were staged. Not set in `create_git_tag_only` mode.
|
|
commit_hash:
|
|
description: Full hash of the created commit. Only set when a commit was actually made (i.e. `changes_detected` is "true").
|
|
create_git_tag_only:
|
|
description: Set to "true" when the action ran in `create_git_tag_only` mode. Never set to "false".
|
|
|
|
runs:
|
|
using: 'node24'
|
|
main: 'index.js'
|
|
|
|
branding:
|
|
icon: 'git-commit'
|
|
color: orange
|