{"id":25543468,"url":"https://github.com/somaz94/go-git-commit-action","last_synced_at":"2026-02-06T03:30:19.159Z","repository":{"id":275895731,"uuid":"927528612","full_name":"somaz94/go-git-commit-action","owner":"somaz94","description":"go-git-commit-action","archived":false,"fork":false,"pushed_at":"2025-02-19T09:34:00.000Z","size":216,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T10:31:12.636Z","etag":null,"topics":["commit","git","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/somaz94.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-05T05:24:21.000Z","updated_at":"2025-02-19T09:34:04.000Z","dependencies_parsed_at":"2025-02-05T06:32:22.502Z","dependency_job_id":"eff19b76-8e8b-4dc4-b1d3-674a76cfee83","html_url":"https://github.com/somaz94/go-git-commit-action","commit_stats":null,"previous_names":["somaz94/go-git-commit-action"],"tags_count":20,"template":false,"template_full_name":"actions/container-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somaz94%2Fgo-git-commit-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somaz94%2Fgo-git-commit-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somaz94%2Fgo-git-commit-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somaz94%2Fgo-git-commit-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somaz94","download_url":"https://codeload.github.com/somaz94/go-git-commit-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239793061,"owners_count":19697893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commit","git","github-actions"],"created_at":"2025-02-20T07:19:32.979Z","updated_at":"2026-02-06T03:30:19.129Z","avatar_url":"https://github.com/somaz94.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Git Commit Action\n\n[![License](https://img.shields.io/github/license/somaz94/go-git-commit-action)](https://github.com/somaz94/go-git-commit-action)\n![Latest Tag](https://img.shields.io/github/v/tag/somaz94/go-git-commit-action)\n![Top Language](https://img.shields.io/github/languages/top/somaz94/go-git-commit-action?color=green\u0026logo=go\u0026logoColor=b)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Go%20Git%20Commit%20Action-blue?logo=github)](https://github.com/marketplace/actions/go-git-commit-action)\n\n## Overview\n\nThe **Go Git Commit Action** is a GitHub Action that automates git commit, push, and tag operations. Written in Go, it provides a reliable and efficient way to commit changes and manage tags in your GitHub Actions workflows. This action is particularly useful for workflows that need to automatically commit changes and manage tags in repositories.\n\n\u003cbr/\u003e\n\n## Inputs\n\n| Input                | Required | Description                    | Default                           |\n|---------------------|----------|--------------------------------|-----------------------------------|\n| `user_email`        | Yes      | Git user email                 | -                                 |\n| `user_name`         | Yes      | Git user name                  | -                                 |\n| `commit_message`    | No       | Commit message                 | Auto commit by Go Git Commit Action |\n| `branch`            | No       | Branch to push to              | main                              |\n| `repository_path`   | No       | Path to the repository         | .                                 |\n| `file_pattern`      | No       | File pattern to add            | .                                 |\n| `tag_name`          | No       | Tag name to create or delete   | -                                 |\n| `tag_message`       | No       | Tag message (for annotated tags)| -                                |\n| `delete_tag`        | No       | Whether to delete the tag      | false                            |\n| `tag_reference`     | No       | Git reference for the tag      | -                                |\n| `create_pr`         | No       | Whether to create a pull request | false                           |\n| `auto_branch`       | No       | Whether to create automatic branch | false                         |\n| `pr_title`          | No       | Pull request title             | Auto PR by Go Git Commit Action   |\n| `pr_base`           | No       | Base branch for pull request   | main                             |\n| `pr_branch`         | No       | Branch to create pull request from | -                            |\n| `delete_source_branch` | No    | Whether to delete source branch after PR | false                   |\n| `github_token`      | No       | GitHub token for PR creation   | -                                |\n| `pr_labels`         | No       | Labels to add to pull request (comma-separated) | -               |\n| `pr_body`           | No       | Custom body message for pull request | -                          |\n| `skip_if_empty`     | No       | Skip the action if there are no changes | false                   |\n| `pr_closed`         | No       | Whether to close the pull request after creation | false          |\n\n\u003cbr/\u003e\n\n## Example Workflows\n\n\u003cbr/\u003e\n\n### Basic Commit Example\n\nBelow is an example of how to use the **Go Git Commit Action** in your GitHub Actions workflow:\n\n```yaml\nname: Auto Commit Workflow\non: [push]\n\npermissions:\n  contents: write\n\njobs:\n  commit:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Auto Commit Changes\n        uses: somaz94/go-git-commit-action@v1\n        with:\n          user_email: actions@github.com\n          user_name: GitHub Actions\n          commit_message: Auto commit by GitHub Actions\n          branch: main\n          repository_path: path/to/repo  # Optional\n          file_pattern: '*.md'             # Example: commit only markdown files\n```\n\n\u003cbr/\u003e\n\n### Creating a Tag\n\n```yaml\nname: Create Tag\non: [workflow_dispatch]\n\npermissions:\n  contents: write\n\njobs:\n  tag:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          token: ${{ secrets.PAT_TOKEN }}\n      \n      - name: Create Git Tag\n        uses: somaz94/go-git-commit-action@v1\n        with:\n          user_email: actions@github.com\n          user_name: GitHub Actions\n          tag_name: v1.0.0\n          tag_message: Release version 1.0.0  # Optional for annotated tags\n```\n\n\u003cbr/\u003e\n\n### Deleting a Tag\n\n```yaml\nname: Delete Tag\non: [workflow_dispatch]\n\npermissions:\n  contents: write\n\njobs:\n  delete-tag:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          token: ${{ secrets.PAT_TOKEN }}\n      \n      - name: Delete Git Tag\n        uses: somaz94/go-git-commit-action@v1\n        with:\n          user_email: actions@github.com\n          user_name: GitHub Actions\n          tag_name: v1.0.0\n          delete_tag: true\n```\n\n\u003cbr/\u003e\n\n### Creating a Tag with Reference\n\n```yaml\nname: Create Tag with Reference\non: [workflow_dispatch]\n\npermissions:\n  contents: write\n\njobs:\n  tag:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      \n      # Create tag pointing to specific commit\n      - name: Create Git Tag at Commit\n        uses: somaz94/go-git-commit-action@v1\n        with:\n          user_email: actions@github.com\n          user_name: GitHub Actions\n          tag_name: v1\n          tag_reference: ${{ github.sha }}  # Points to specific commit SHA\n          \n      # Create tag pointing to another tag\n      - name: Create Git Tag from Tag\n        uses: somaz94/go-git-commit-action@v1\n        with:\n          user_email: actions@github.com\n          user_name: GitHub Actions\n          tag_name: latest\n          tag_reference: v1.0.2  # Points to existing tag\n          \n      # Create tag pointing to branch\n      - name: Create Git Tag from Branch\n        uses: somaz94/go-git-commit-action@v1\n        with:\n          user_email: actions@github.com\n          user_name: GitHub Actions\n          tag_name: stable\n          tag_reference: main  # Points to branch\n```\n\n\u003cbr/\u003e\n\n### Create Pull Request\n\n#### Using Custom Branch (Default)\n```yaml\n- uses: somaz94/go-git-commit-action@v1\n  with:\n    user_email: actions@github.com\n    user_name: GitHub Actions\n    create_pr: true\n    auto_branch: false  # Default value\n    branch: feature/my-branch # Not Required: Push branch for commit and tag (Default: main)\n    pr_branch: feature/my-branch  # Required: Source branch for PR\n    pr_base: main                 # Required: Target branch for PR\n    github_token: ${{ secrets.PAT_TOKEN }}\n```\n\n#### Using Auto Branch (Creates timestamped branch from pr_branch)\n```yaml\n- uses: somaz94/go-git-commit-action@v1\n  with:\n    user_email: actions@github.com\n    user_name: GitHub Actions\n    create_pr: true\n    auto_branch: true   # Will create 'update-files-{timestamp}' branch from pr_branch\n    branch: main # Not Required: Push branch for commit and tag (Default: main)\n    pr_branch: feature/my-branch  # Required: Base branch for auto-generated branch\n    pr_base: main                 # Required: Target branch for PR\n    github_token: ${{ secrets.PAT_TOKEN }}\n```\n\n#### With Custom PR Title and Labels\n```yaml\n- uses: somaz94/go-git-commit-action@v1\n  with:\n    user_email: actions@github.com\n    user_name: GitHub Actions\n    create_pr: true\n    auto_branch: false\n    branch: feature/my-branch # Not Required: Push branch for commit and tag (Default: main)\n    pr_branch: feature/my-branch  # Required: Source branch for PR\n    pr_base: main                 # Required: Target branch for PR\n    pr_title: \"feat: my custom PR title\"\n    pr_labels: \"enhancement,automated,test\"\n    github_token: ${{ secrets.PAT_TOKEN }}\n```\n\n#### With Auto Branch and Delete Source Branch\n```yaml\n- uses: somaz94/go-git-commit-action@v1\n  with:\n    user_email: actions@github.com\n    user_name: GitHub Actions\n    create_pr: true\n    auto_branch: true   # Will create 'update-files-{timestamp}' branch\n    branch: main # Not Required: Push branch for commit and tag (Default: main)\n    pr_branch: feature/my-branch  # Required: Base branch for auto-generated branch\n    pr_base: main                 # Required: Target branch for PR\n    delete_source_branch: true    # Will delete the auto-generated branch after PR\n    github_token: ${{ secrets.PAT_TOKEN }}\n```\n\n#### With Labels and Custom Body\n```yaml\n- uses: somaz94/go-git-commit-action@v1\n  with:\n    user_email: actions@github.com\n    user_name: GitHub Actions\n    create_pr: true\n    auto_branch: false\n    branch: main # Not Required: Push branch for commit and tag (Default: main)\n    pr_branch: feature/my-branch  # Required: Source branch for PR\n    pr_base: main                 # Required: Target branch for PR\n    pr_labels: \"enhancement,automated,test\"\n    pr_body: |\n      ## Custom Pull Request\n      This PR was automatically created with custom labels and body.\n      \n      ### Changes\n      - Feature 1\n      - Feature 2\n    github_token: ${{ secrets.PAT_TOKEN }}\n```\n\n#### Skip If Empty Changes\n```yaml\n- uses: somaz94/go-git-commit-action@v1\n  with:\n    user_email: actions@github.com\n    user_name: GitHub Actions\n    create_pr: true\n    auto_branch: false\n    branch: feature/my-branch # Not Required: Push branch for commit and tag (Default: main)\n    pr_branch: feature/my-branch  # Required: Source branch for PR\n    pr_base: main                 # Required: Target branch for PR\n    skip_if_empty: true          # Skips PR creation if no changes detected\n    github_token: ${{ secrets.PAT_TOKEN }}\n```\n\n#### Auto Close Pull Request\n```yaml\n- uses: somaz94/go-git-commit-action@v1\n  with:\n    user_email: actions@github.com\n    user_name: GitHub Actions\n    create_pr: true\n    auto_branch: false\n    branch: main # Not Required: Push branch for commit and tag (Default: main)\n    pr_branch: feature/my-branch  # Required: Source branch for PR\n    pr_base: main                 # Required: Target branch for PR\n    pr_closed: true              # Automatically closes PR after creation\n    pr_title: \"Auto Close PR Example\"\n    pr_body: \"This PR will be automatically closed after creation\"\n    github_token: ${{ secrets.PAT_TOKEN }}\n```\n\n\u003cbr/\u003e\n\n## Features\n\n- Written in Go for better performance and reliability\n- Supports custom git user configuration\n- Flexible file pattern matching\n- Optional repository path specification\n- Automatic branch pushing\n- Detailed error reporting\n- Git tag management (create and delete)\n- Support for both lightweight and annotated tags\n- Automatic tag pushing to remote\n- Support for creating tags pointing to specific commits, tags, or branches\n- Flexible tag reference system\n- Support for PR labels and custom body messages\n- Skip action when no changes are detected\n- Auto-close PR functionality\n- Detailed change detection between branches\n\n\u003cbr/\u003e\n\n## Notes\n\n### General\n- The action automatically handles git configuration\n- If `repository_path` is not specified, it uses the current directory\n- `file_pattern` supports standard git pattern matching\n- The action will skip the commit if there are no changes to commit\n\n### Branch Operations\n- The `branch` parameter is used for simple commit and tag operations (without PR)\n- For pull request operations:\n  - `pr_branch`: Specifies the source branch for the PR\n  - `pr_base`: Specifies the target branch for the PR\n  - When `auto_branch: true`, a new branch is created with format 'update-files-{timestamp}' based on `pr_branch`\n  - When `auto_branch: false` (default), the PR is created directly from `pr_branch` to `pr_base`\n\n### Tag Operations\n- Tag operations are optional and only executed when `tag_name` is provided\n- Use `tag_message` to create annotated tags\n- Set `delete_tag: 'true'` to delete a tag both locally and remotely\n- Use `tag_reference` to create tags pointing to specific commits, other tags, or branches\n- The `branch` parameter is used to specify which branch to tag\n\n### Pull Request Operations\n- Set `create_pr: 'true'` to create a pull request\n- `pr_branch` and `pr_base` are required when creating a PR:\n  - `pr_branch`: The source branch containing your changes\n  - `pr_base`: The target branch where changes will be merged\n- When `auto_branch: true`:\n  - Creates a new timestamped branch from `pr_branch`\n  - The new branch name format is 'update-files-{timestamp}'\n  - This is useful for automated updates that need unique branch names\n- `pr_title` can be customized (defaults to \"Auto PR: %s to %s (Run ID: %s)\")\n- Use `pr_labels` to add labels to the PR (comma-separated)\n- Use `pr_body` to set a custom PR description\n- Enable `skip_if_empty` to skip the action when no changes are detected\n- Set `pr_closed: 'true'` to automatically close the PR after creation\n- Set `delete_source_branch: 'true'` to automatically delete the source branch after PR is created (only works with `auto_branch: true`)\n\n\u003cbr/\u003e\n\n### Authentication\n- When working with workflow files or tags, you need to use a Personal Access Token (PAT) with appropriate permissions:\n  ```yaml\n  - uses: actions/checkout@v4\n    with:\n      token: ${{ secrets.PAT_TOKEN }}  # Required for tag operations\n  ```\n  This is especially important when you need to push tags or modify workflow files, as the default GITHUB_TOKEN may not have sufficient permissions.\n- The `github_token` input is required for creating pull requests\n\n\u003cbr/\u003e\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n\u003cbr/\u003e\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomaz94%2Fgo-git-commit-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomaz94%2Fgo-git-commit-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomaz94%2Fgo-git-commit-action/lists"}