{"id":17966238,"url":"https://github.com/devops-infra/action-commit-push","last_synced_at":"2025-04-05T04:10:44.041Z","repository":{"id":38303480,"uuid":"255114565","full_name":"devops-infra/action-commit-push","owner":"devops-infra","description":"GitHub Action that will create a new commit and push it to the repository","archived":false,"fork":false,"pushed_at":"2025-02-28T18:51:08.000Z","size":228,"stargazers_count":70,"open_issues_count":3,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T03:06:35.619Z","etag":null,"topics":["automation","ci-cd","cicd","commit","devops","devops-workflow","docker","dockerhub","github-action","github-action-docker","github-actions","github-actions-docker","iaac","push"],"latest_commit_sha":null,"homepage":"https://christophshyper.github.io/","language":"Makefile","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/devops-infra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-12T15:38:48.000Z","updated_at":"2025-03-12T12:16:50.000Z","dependencies_parsed_at":"2024-04-27T20:26:42.120Z","dependency_job_id":"9fc0b614-b4cd-4286-8d5f-c41a0452ed9b","html_url":"https://github.com/devops-infra/action-commit-push","commit_stats":{"total_commits":114,"total_committers":4,"mean_commits":28.5,"dds":0.5877192982456141,"last_synced_commit":"36f19ebfe494190521a77c58688838942cf74b6e"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":"devops-infra/template-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-infra%2Faction-commit-push","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-infra%2Faction-commit-push/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-infra%2Faction-commit-push/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-infra%2Faction-commit-push/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devops-infra","download_url":"https://codeload.github.com/devops-infra/action-commit-push/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"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":["automation","ci-cd","cicd","commit","devops","devops-workflow","docker","dockerhub","github-action","github-action-docker","github-actions","github-actions-docker","iaac","push"],"created_at":"2024-10-29T13:08:36.639Z","updated_at":"2025-04-05T04:10:44.023Z","avatar_url":"https://github.com/devops-infra.png","language":"Makefile","readme":"# GitHub Action for committing changes to a repository.\n\n### Supporting `amd64` and `aarch64/arm64` images!\n\nUseful in combination with my other action [devops-infra/action-pull-request](https://github.com/devops-infra/action-pull-request).\n\nAvailable in Docker Hub: [devopsinfra/action-commit-push:latest](https://hub.docker.com/repository/docker/devopsinfra/action-commit-push)\n\u003cbr\u003e\nAnd GitHub Packages: [ghcr.io/devops-infra/action-commit-push/action-commit-push:latest](https://github.com/orgs/devops-infra/packages/container/package/action-commit-push)\n\n\nFeatures:\n* Can add a custom prefix to commit message title by setting `commit_prefix`.\n* As a commit message title will use `commit_message` if set, or `commit_prefix` and add changed files or just list of changed files.\n* Can create a new branch when `target_branch` is set.\n* Can add a timestamp to a branch name (great for cron-based updates): \n  * When `target_branch` is set and `add_timestamp` is `true` will create a branch named `${branch_name}/${add_timestamp}`. \n  * When `target_branch` is not set and `add_timestamp` is `true` will create a branch named `${add_timestamp}`.\n* Good to combine with my other action [devops-infra/action-pull-request](https://github.com/devops-infra/action-pull-request).\n* Can use `git push --force` for fast-forward changes with `force` input.\n\n\n## Badge swag\n[\n![GitHub repo](https://img.shields.io/badge/GitHub-devops--infra%2Faction--commit--push-blueviolet.svg?style=plastic\u0026logo=github)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/devops-infra/action-commit-push?color=blueviolet\u0026label=Code%20size\u0026style=plastic\u0026logo=github)\n![GitHub last commit](https://img.shields.io/github/last-commit/devops-infra/action-commit-push?color=blueviolet\u0026logo=github\u0026style=plastic\u0026label=Last%20commit)\n![GitHub license](https://img.shields.io/github/license/devops-infra/action-commit-push?color=blueviolet\u0026logo=github\u0026style=plastic\u0026label=License)\n](https://github.com/devops-infra/action-commit-push \"shields.io\")\n\u003cbr\u003e\n[\n![DockerHub](https://img.shields.io/badge/DockerHub-devopsinfra%2Faction--commit--push-blue.svg?style=plastic\u0026logo=docker)\n![Docker version](https://img.shields.io/docker/v/devopsinfra/action-commit-push?color=blue\u0026label=Version\u0026logo=docker\u0026style=plastic)\n![Image size](https://img.shields.io/docker/image-size/devopsinfra/action-commit-push/latest?label=Image%20size\u0026style=plastic\u0026logo=docker)\n![Docker Pulls](https://img.shields.io/docker/pulls/devopsinfra/action-commit-push?color=blue\u0026label=Pulls\u0026logo=docker\u0026style=plastic)\n](https://hub.docker.com/r/devopsinfra/action-commit-push \"shields.io\")\n\n\n## Reference\n\n```yaml\n    - name: Run the Action\n      uses: devops-infra/action-commit-push@master\n      with:\n        github_token: \"${{ secrets.GITHUB_TOKEN }}\"\n        add_timestamp: true\n        commit_prefix: \"[AUTO]\"\n        commit_message: \"Automatic commit\"\n        force: false\n        target_branch: update/version\n```\n\n\n| Input Variable      | Required | Default          | Description                                                                                                                                                        |\n| ------------------- | -------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| github_token        | Yes      | `\"\"`             | Personal Access Token for GitHub for pushing the code.                                                                                                             |\n| add_timestamp       | No       | `false`          | Whether to add the timestamp to a new branch name. Uses format `%Y-%m-%dT%H-%M-%SZ`.                                                                               |\n| amend               | No       | `false`          | Whether to make amendment to the previous commit (`--amend`). Cannot be used together with `commit_message` or `commit_prefix`.                                    |\n| commit_prefix       | No       | `\"\"`             | Prefix added to commit message. Combines with `commit_message`.                                                                                                    |\n| commit_message      | No       | `\"\"`             | Commit message to set. Combines with `commit_prefix`. Cannot be used together with `amend`.                                                                        |\n| force               | No       | `false`          | Whether to use force push for fast-forward changes (`--force`). Use only if necessary, e.g. when using `--amend`. And set `fetch-depth: 0` for `actions/checkout`. |\n| no_edit             | No       | `false`          | Whether to not edit commit message when using amend (`--no-edit`).                                                                                                 |\n| organization_domain | No       | `github.com`     | Github Enterprise domain name.                                                                                                                                     |\n| target_branch       | No       | *current branch* | Name of a new branch to push the code into. Creates branch if not existing.                                                                                        |\n\n| Outputs       | Description                                                              |\n| ------------- | ------------------------------------------------------------------------ |\n| files_changed | List of changed files. As returned by `git diff --staged --name-status`. |\n| branch_name   | Name of the branch code was pushed into.                                 |\n\n\n## Examples\n\nCommit and push changes to currently checked out branch.\n```yaml\nname: Push changes\non:\n  push\njobs:\n  change-and-push:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@master\n      - name: Change something\n        run: |\n          find . -type f -name \"*.md\" -print0 | xargs -0 sed -i \"s/foo/bar/g\"\n      - name: Commit and push changes\n        uses: devops-infra/action-commit-push@master\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          commit_message: Replaced foo with bar\n```\n\nCommit and push changes to a new branch and create pull request using my other action [devops-infra/action-pull-request](https://github.com/devops-infra/action-pull-request).\n```yaml\nname: Push changes\non:\n  push\njobs:\n  change-and-push:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@master\n      - name: Change something\n        run: |\n          find . -type f -name \"*.md\" -print0 | xargs -0 sed -i \"s/foo/bar/g\"\n      - name: Commit and push changes\n        uses: devops-infra/action-commit-push@master\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          commit_prefix: \"[AUTO-COMMIT] foo/bar replace\"\n      - name: Create pull request\n        uses: devops-infra/action-pull-request@master\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          body: \"**Automated pull request**\u003cbr\u003e\u003cbr\u003eReplaced foo/bar\"\n          title: ${{ github.event.commits[0].message }}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-infra%2Faction-commit-push","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevops-infra%2Faction-commit-push","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-infra%2Faction-commit-push/lists"}