{"id":14070372,"url":"https://github.com/chinthakagodawita/autoupdate","last_synced_at":"2025-04-06T22:09:19.416Z","repository":{"id":39151892,"uuid":"227842769","full_name":"chinthakagodawita/autoupdate","owner":"chinthakagodawita","description":"A GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch.","archived":false,"fork":false,"pushed_at":"2024-02-12T14:59:02.000Z","size":1413,"stargazers_count":171,"open_issues_count":30,"forks_count":43,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-23T02:35:10.156Z","etag":null,"topics":["github","github-action","github-actions","hacktoberfest","pull-requests"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/chinthakagodawita.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-13T13:09:14.000Z","updated_at":"2024-06-16T22:47:19.280Z","dependencies_parsed_at":"2024-06-16T22:47:07.667Z","dependency_job_id":"22febee5-7ac3-4180-b751-209911a59fc2","html_url":"https://github.com/chinthakagodawita/autoupdate","commit_stats":{"total_commits":156,"total_committers":11,"mean_commits":"14.181818181818182","dds":"0.33333333333333337","last_synced_commit":"52ccf1c49e370af0298840fd6348e6deb1f8b96b"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinthakagodawita%2Fautoupdate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinthakagodawita%2Fautoupdate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinthakagodawita%2Fautoupdate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinthakagodawita%2Fautoupdate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinthakagodawita","download_url":"https://codeload.github.com/chinthakagodawita/autoupdate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["github","github-action","github-actions","hacktoberfest","pull-requests"],"created_at":"2024-08-13T07:07:42.358Z","updated_at":"2025-04-06T22:09:19.391Z","avatar_url":"https://github.com/chinthakagodawita.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# autoupdate\n\n![Tests](https://github.com/chinthakagodawita/autoupdate/workflows/Tests/badge.svg?event=push) [![codecov](https://codecov.io/gh/chinthakagodawita/autoupdate/branch/master/graph/badge.svg)](https://codecov.io/gh/chinthakagodawita/autoupdate)\n\n**autoupdate** is a GitHub Action that auto-updates pull requests branches whenever changes land on their destination branch.\n\n## Usage\n\nCreate a file, in your repository, at `.github/workflows/autoupdate.yaml` with the following:\n\n```yaml\nname: autoupdate\non:\n  # This will trigger on all pushes to all branches.\n  push: {}\n  # Alternatively, you can only trigger if commits are pushed to certain branches, e.g.:\n  # push:\n  #   branches:\n  #     - master\n  #     - unstable\njobs:\n  autoupdate:\n    name: autoupdate\n    runs-on: ubuntu-22.04\n    steps:\n      - uses: docker://chinthakagodawita/autoupdate-action:v1\n        env:\n          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'\n```\n\nThis will trigger on all pushes and automatically update any pull requests, if changes are pushed to their destination branch.\n\nFor more information on customising event triggers, see [Github's documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#push-event-push).\n\nThe following events are supported:\n\n- push\n- pull_request\n- workflow_run\n- workflow_dispatch\n- schedule\n\n## Configuration\n\nThe following configuration options are supported. To change any of these, simply specify it as an `env` value in your workflow file.\n\nAll configuration values, except `GITHUB_TOKEN`, are optional.\n\n- `GITHUB_TOKEN`: _autoupdate_ uses this token to perform its operations on your repository. This should generally be set to `\"${{ secrets.GITHUB_TOKEN }}\"`.\n\n  You _may_ want to override this if you want the action to run as a different user than the default actions bot.\n\n- `DRY_RUN`: Enables 'dry run' mode, possible values are `\"true\"` or `\"false\"` (default).\n\n  In dry run mode, merge/update operations are logged to the console but not performed. This can be useful if you're testing this action or testing a particular configuration value.\n\n- `PR_FILTER`: Controls how _autoupdate_ chooses which pull requests to operate on. Possible values are:\n\n  - `\"all\"` (default): No filter, _autoupdate_ will monitor and update all pull requests.\n  - `\"labelled\"`: Only monitor PRs with a particular label (or set of labels). Requires the `PR_LABELS` option to be defined to. If `PR_LABELS` is not defined, _autoupdate_ will not monitor any pull requests.\n  - `\"protected\"`: Only monitor PRs that are raised against [protected branches](https://help.github.com/en/github/administering-a-repository/about-protected-branches).\n  - `\"auto_merge\"`: Only monitor PRs that have ['auto merge'](https://docs.github.com/en/github/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request) enabled\n\n- `PR_LABELS`: Controls which labels _autoupdate_ will look for when monitoring PRs. Only used if `PR_FILTER=\"labelled\"`. This can be either a single label or a comma-separated list of labels.\n\n- `PR_READY_STATE`: Controls how _autoupdate_ monitors pull requests based on their current [draft / ready for review](https://help.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request) state. Possible values are:\n\n  - `\"all\"`: (default): No filter, _autoupdate_ will monitor and update pull requests regardless of ready state.\n  - `\"ready_for_review\"`: Only monitor PRs that are not currently in the draft state.\n  - `\"draft\"`: Only monitor PRs that are currently in the draft state.\n\n- `EXCLUDED_LABELS`: Controls which labels _autoupdate_ will ignore when evaluating otherwise-included PRs. This option works with all `PR_FILTER` options and can be either a single label or a comma-separated list of labels.\n\n- `MERGE_MSG`: A custom message to use when creating the merge commit from the destination branch to your pull request's branch.\n\n- `RETRY_COUNT`: The number of times a branch update should be attempted before _autoupdate_ gives up (default: `\"5\"`).\n\n- `RETRY_SLEEP`: The amount of time (in milliseconds) that _autoupdate_ should wait between branch update attempts (default: `\"300\"`).\n\n- `MERGE_CONFLICT_ACTION`: Controls how _autoupdate_ handles a merge conflict when updating a PR. Possible values are:\n  - `\"fail\"` (default): _autoupdate_ will report a failure on each PR that has a merge conflict.\n  - `\"ignore\"`: _autoupdate_ will silently ignore merge conflicts.\n\nHere's an example workflow file with all of the above options specified:\n\n```yaml\nname: autoupdate\non:\n  push: {}\njobs:\n  autoupdate:\n    name: autoupdate\n    runs-on: ubuntu-22.04\n    steps:\n      - uses: docker://chinthakagodawita/autoupdate-action:v1\n        env:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n          DRY_RUN: \"false\"\n          PR_FILTER: \"labelled\"\n          PR_LABELS: \"autoupdate,keep up-to-date,integration\"\n          EXCLUDED_LABELS: \"dependencies,wontfix\"\n          MERGE_MSG: \"Branch was auto-updated.\"\n          RETRY_COUNT: \"5\"\n          RETRY_SLEEP: \"300\"\n          MERGE_CONFLICT_ACTION: \"fail\"\n```\n\n## Outputs\n\n| Name         | Description                                                                 |\n| ------------ | --------------------------------------------------------------------------- |\n| `conflicted` | `true` or `false` which indicates whether merge conflicts were found or not |\n\nHere's an example workflow file with the outputs above:\n\n```yaml\nname: autoupdate\non:\n  push: {}\njobs:\n  autoupdate:\n    name: autoupdate\n    runs-on: ubuntu-18.04\n    steps:\n      - uses: docker://chinthakagodawita/autoupdate-action:v1\n        id: autoupdate\n        env:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n          MERGE_CONFLICT_ACTION: \"ignore\"\n\n      - run: echo 'Merge conflicts found!'\n        if: ${{ steps.autoupdate.outputs.conflicted }}\n\n      - run: echo 'No merge conflicts'\n        if: ${{ !steps.autoupdate.outputs.conflicted }}\n```\n\n## Examples\n\nSee [chinthakagodawita/autoupdate-test/pulls](https://github.com/chinthakagodawita/autoupdate-test/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) for a repository where autoupdate is enabled. This is currently configured to only run on PRs that have the `autoupdate` tag added to them.\n\nHere's a screenshot:\n\n![An example of autoupdate running on a pull request](/docs/images/autoupdate-example.png)\n\n## Limitations\n\n- Branch updates events caused by this action will not trigger any subsequent workflows\n  - [This is a documented limitation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#about-workflow-events) for all GH actions:\n    \u003e An action in a workflow run can't trigger a new workflow run. For example, if an action pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.\n  - There is [an open issue in the Github community forum](https://github.com/orgs/community/discussions/43427) tracking this\n\n## Coming soon\n\n- Rebase support\n- Token support in custom merge messages\n\n## Also see\n\n- [automerge](https://github.com/pascalgn/automerge-action/) for automatic merging of PRs\n- [autosquash](https://github.com/tibdex/autosquash) for auto-merging with squash support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinthakagodawita%2Fautoupdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinthakagodawita%2Fautoupdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinthakagodawita%2Fautoupdate/lists"}