maxgfr/GitHub Commit Push File
Github action which lets you to commit and push a file to a repository.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Mar 30, 2026
- License
- MIT
Pinned Snippet
uses: maxgfr/github-commit-push-file@e0a252df0f091b46232980b3c1845a53913e76cb # v0.4.1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| commit_message | The commit message (required unless commits is provided). Supports template variables: {{date}}, {{datetime}}, {{sha}}, {{sha:short}}, {{branch}}, {{run_id}}, {{run_number}}, {{actor}}, {{repository}}. | no | — |
| commit_body | Optional commit body (appended after commit message with a blank line). Supports template variables. | no | "" |
| files | Files to add (space-separated, supports quoted paths and glob patterns). Defaults to all files (-A) | no | -A |
| branch | Target branch to push to. Defaults to the current branch | no | "" |
| author_name | The name of the commit author. Defaults to GITHUB_ACTOR | no | "" |
| author_email | The email of the commit author. Defaults to GITHUB_ACTOR@users.noreply.github.com | no | "" |
| sign_commit | Whether to sign the commit with GPG (requires GPG key setup) | no | false |
| gpg_private_key | GPG private key (base64 encoded) for signing commits | no | "" |
| gpg_passphrase | Passphrase for the GPG private key | no | "" |
| force_push | Whether to force push | no | true |
| skip_if_no_changes | Skip commit and push if there are no changes | no | true |
| skip_hooks | Whether to skip git hooks (--no-verify) on commit | no | true |
| work_dir | Working directory to execute git commands in. Defaults to the repository root | no | — |
| dry_run | Show what would be committed without actually committing or pushing | no | false |
| tag | Optional tag to create on the commit | no | "" |
| tag_message | Message for annotated tag (if empty, creates a lightweight tag) | no | "" |
| create_branch | Create the target branch if it does not exist on the remote | no | false |
| create_pr | Whether to create a pull request after pushing (requires token) | no | false |
| pr_title | Title for the pull request (defaults to commit message). Supports template variables. | no | "" |
| pr_base_branch | Base branch for the pull request (defaults to the repository default branch) | no | "" |
| pr_body | Body for the pull request. Supports template variables. | no | "" |
| pr_labels | Comma-separated list of labels to add to the pull request | no | "" |
| pr_draft | Whether to create the pull request as a draft | no | false |
| token | GitHub token for authentication (used for push auth and PR creation) | no | "" |
| commits | JSON array of commits to make [{message, files, body?}]. Each commit must declare its own files. Overrides commit_message/files if provided. Supports template variables. | no | "" |
| amend | Amend the last commit instead of creating a new one (cannot be used with commits array) | no | false |
| retry_on_conflict | Retry push with pull --rebase if it fails due to remote changes (only when force_push is false) | no | false |
| max_retries | Number of push retries after the initial attempt fails, when retry_on_conflict is enabled (total attempts = max_retries + 1) | no | 3 |
| exclude_files | Files/patterns to exclude from staging (space-separated, supports quoted paths). Applied after git add. | no | "" |
| pathspec_from_file | Path to a file containing the list of files to add (one per line). Takes precedence over files input. | no | "" |
| commit_timestamp | Override commit date (sets GIT_AUTHOR_DATE and GIT_COMMITTER_DATE). Accepts any git-compatible date format. | no | "" |
| commit_name | [DEPRECATED] Use commit_message instead | no | "" |
Outputs
| name | description |
|---|---|
| committed | Whether a commit was made (true/false) |
| commit_sha | The SHA of the last commit (if committed) |
| commit_shas | JSON array of all commit SHAs |
| commit_url | The GitHub URL of the last commit |
| changed_files | JSON array of files changed across all commits |
| pr_url | The URL of the created pull request (if create_pr was used) |
| pr_number | The number of the created pull request (if create_pr was used) |