{"id":17267822,"url":"https://github.com/tj-actions/sync-release-version","last_synced_at":"2025-04-14T08:03:51.093Z","repository":{"id":37861784,"uuid":"273349885","full_name":"tj-actions/sync-release-version","owner":"tj-actions","description":":octocat: Github action to modify specific project files with an updated version of your project based on each release tag.","archived":false,"fork":false,"pushed_at":"2025-01-15T18:41:50.000Z","size":527,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-15T14:29:09.509Z","etag":null,"topics":["actions","auto-documentation","ci","github-actions","release-automation","semantic-versioning","semver-release","sync","version"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/tj-actions.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["jackton1"],"patreon":null,"open_collective":"tj-actions","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":[]}},"created_at":"2020-06-18T22:12:25.000Z","updated_at":"2025-01-15T15:34:48.000Z","dependencies_parsed_at":"2023-11-19T05:25:02.339Z","dependency_job_id":"4ca15f2c-1d16-4549-9ab7-b4a53b2cb193","html_url":"https://github.com/tj-actions/sync-release-version","commit_stats":{"total_commits":557,"total_committers":11,"mean_commits":50.63636363636363,"dds":0.5960502692998204,"last_synced_commit":"fffe5537a504794fc4e0f85bb7f1b37cc3ff1fa6"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-actions%2Fsync-release-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-actions%2Fsync-release-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-actions%2Fsync-release-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-actions%2Fsync-release-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tj-actions","download_url":"https://codeload.github.com/tj-actions/sync-release-version/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727280,"owners_count":19687144,"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":["actions","auto-documentation","ci","github-actions","release-automation","semantic-versioning","semver-release","sync","version"],"created_at":"2024-10-15T08:11:42.517Z","updated_at":"2025-04-14T08:03:51.067Z","avatar_url":"https://github.com/tj-actions.png","language":"Shell","funding_links":["https://github.com/sponsors/jackton1","https://opencollective.com/tj-actions","https://www.buymeacoffee.com/jackton1"],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://app.codacy.com/project/badge/Grade/55332b43f1ba4db9a3648bcbffae800a)](https://app.codacy.com/gh/tj-actions/sync-release-version/dashboard?utm_source=gh\\\u0026utm_medium=referral\\\u0026utm_content=\\\u0026utm_campaign=Badge_grade)\n[![CI](https://github.com/tj-actions/sync-release-version/workflows/CI/badge.svg)](https://github.com/tj-actions/sync-release-version/actions?query=workflow%3ACI)\n[![Update release version.](https://github.com/tj-actions/sync-release-version/workflows/Update%20release%20version./badge.svg)](https://github.com/tj-actions/sync-release-version/actions?query=workflow%3A%22Update+release+version.%22)\n[![Public workflows that use this action.](https://img.shields.io/endpoint?url=https%3A%2F%2Fused-by.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Dtj-actions%2Fsync-release-version%26badge%3Dtrue)](https://github.com/search?o=desc\\\u0026q=tj-actions+sync-release-version+path%3A.github%2Fworkflows+language%3AYAML\\\u0026s=\\\u0026type=Code)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n## sync-release-version\n\n## Problem\n\nWith multiple files that need to be updated each time a new released is created.\n\n`sync-release-version` makes this process less complex by using a regex pattern to match the lines in the specified files that needs to be updated.\n\n## Helpful Resources\n\n*   https://www.regextester.com/111539\n*   https://www.tutorialspoint.com/unix/unix-regular-expressions.htm\n\n## Usage\n\n#### Sync a project release version number.\n\nUpdate files that reference a project version with a new release number.\n\n\u003e \\[!NOTE]\n\u003e\n\u003e *   This example assumes a post release operation i.e changes are made to a README after a new version is releaased.\n\n```yaml\n...\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0 # otherwise, you will fail to push refs to dest repo\n\n      - name: Sync release version.\n        uses: tj-actions/sync-release-version@2a7ef0deb39b3ecce887ee99d2261c6cef989d84 # v13\n          id: sync-release-version\n          with:\n            pattern: 'version='\n            current_version: '1.0.1'  # Omit this to use git tag.\n            new_version: '1.0.2'  # Omit this to use git tag.\n            paths: |\n              README.md\n              test/subdir/README.md\n\n      - run: |\n          echo \"Upgraded from ${{ steps.sync-release-version.outputs.old_version }} -\u003e ${{ steps.sync-release-version.outputs.new_version }}\" \n```\n\n### Recomended usage with [peter-evans/create-pull-request@v3](https://github.com/peter-evans/create-pull-request)\n\n```yaml\nname: Update release version.\non:\n  release:\n    types: [published]\n\n\njobs:\n  update-version:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n \n      - name: Sync release version.\n        uses: tj-actions/sync-release-version@2a7ef0deb39b3ecce887ee99d2261c6cef989d84 # v13\n        id: sync-release-version\n        with:\n          pattern: 'tj-actions/sync-release-version@'\n          paths: |\n            README.md\n \n      - name: Create Pull Request\n        uses: peter-evans/create-pull-request@v3\n        with:\n          base: \"main\"\n          title: \"Upgraded to ${{ steps.sync-release-version.outputs.new_version }}\"\n          branch: \"upgrade-to-${{ steps.sync-release-version.outputs.new_version }}\"\n          commit-message: \"Upgraded from ${{ steps.sync-release-version.outputs.old_version }} -\u003e ${{ steps.sync-release-version.outputs.new_version }}\"\n          body: \"View [CHANGES](https://github.com/${{ github.repository }}/compare/${{ steps.sync-release-version.outputs.old_version }}...${{ steps.sync-release-version.outputs.new_version }})\"\n          reviewers: \"jackton1\"\n```\n\n## Example\n\n![Sample](https://user-images.githubusercontent.com/17484350/197892710-7238ba98-fc60-4011-a133-40e1ae1ebf7b.png)\n\nCreating a new release `v6.8 -\u003e v7` using the recommended configuration above.\n\n#### BEFORE\n\n`README.md`\n\n```yaml\n...\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n      - name: Sync release version.\n        uses: tj-actions/sync-release-version@v6.8\n```\n\n#### AFTER\n\n`README.md`\n\n```yaml\n...\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n      - name: Sync release version.\n        uses: tj-actions/sync-release-version@v7\n```\n\n## Inputs\n\n\u003c!-- AUTO-DOC-INPUT:START - Do not remove or modify this section --\u003e\n\n|                                           INPUT                                           |  TYPE  | REQUIRED |  DEFAULT  |                                                                  DESCRIPTION                                                                   |\n|-------------------------------------------------------------------------------------------|--------|----------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------|\n|       \u003ca name=\"input_current_version\"\u003e\u003c/a\u003e[current\\_version](#input_current_version)       | string |  false   |           |                                           The current project version (Default: The last git tag).                                             |\n|             \u003ca name=\"input_new_version\"\u003e\u003c/a\u003e[new\\_version](#input_new_version)             | string |  false   |           |                                             The next project version (Default: The new git tag).                                               |\n|              \u003ca name=\"input_only_major\"\u003e\u003c/a\u003e[only\\_major](#input_only_major)               | string |  false   | `\"false\"` |                                                   Only update the major version \u003cbr\u003enumber.                                                    |\n|                      \u003ca name=\"input_paths\"\u003e\u003c/a\u003e[paths](#input_paths)                      | string |   true   |           |                                           A list of file names \u003cbr\u003eto search and replace versions.                                             |\n|                   \u003ca name=\"input_pattern\"\u003e\u003c/a\u003e[pattern](#input_pattern)                   | string |  false   |           |                                      The pattern to match the \u003cbr\u003elocation that needs to be \u003cbr\u003eupdated.                                       |\n|           \u003ca name=\"input_strip_prefix\"\u003e\u003c/a\u003e[strip\\_prefix](#input_strip_prefix)            | string |  false   |           | Prefix to strip from the \u003cbr\u003etag. For example if `strip_prefix` \u003cbr\u003eis set to `v` and \u003cbr\u003ethe tag is `v1.0.0` the \u003cbr\u003eoutput becomes `1.0.0`.  |\n| \u003ca name=\"input_use_tag_commit_hash\"\u003e\u003c/a\u003e[use\\_tag\\_commit\\_hash](#input_use_tag_commit_hash) | string |  false   | `\"false\"` |              When true, uses commit hash \u003cbr\u003ein the replacement pattern. For \u003cbr\u003eexample, replaces `hash # v1` with `hash # v2`.               |\n\n\u003c!-- AUTO-DOC-INPUT:END --\u003e\n\n## Outputs\n\n\u003c!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section --\u003e\n\n|                                          OUTPUT                                          |  TYPE  |                 DESCRIPTION                  |\n|------------------------------------------------------------------------------------------|--------|----------------------------------------------|\n| \u003ca name=\"output_is_initial_release\"\u003e\u003c/a\u003e[is\\_initial\\_release](#output_is_initial_release) | string |    Boolean indicating an initial release.    |\n|          \u003ca name=\"output_major_update\"\u003e\u003c/a\u003e[major\\_update](#output_major_update)          | string | Boolean indicating a major version \u003cbr\u003ebump  |\n|           \u003ca name=\"output_new_version\"\u003e\u003c/a\u003e[new\\_version](#output_new_version)            | string |         The current project version          |\n|           \u003ca name=\"output_old_version\"\u003e\u003c/a\u003e[old\\_version](#output_old_version)            | string |         The previous project version         |\n\n\u003c!-- AUTO-DOC-OUTPUT:END --\u003e\n\n*   Free software: [MIT license](LICENSE)\n\nIf you feel generous and want to show some extra appreciation:\n\n[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]\n\n[buymeacoffee]: https://www.buymeacoffee.com/jackton1\n\n[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\n\n## Features\n\n*   Modifies files with an up to date version of your project based on each release tag.\n\n## Known Limitation\n\n\u003e \\[!IMPORTANT]\n\u003e\n\u003e *   To ignore certain lines from getting updated ensure the version used doesn't match either the current or previous version.\n\n## Credits\n\nThis package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter).\n\n## Report Bugs\n\nReport bugs at https://github.com/tj-actions/sync-release-version/issues.\n\nIf you are reporting a bug, please include:\n\n*   Your operating system name and version.\n*   Any details about your workflow that might be helpful in troubleshooting.\n*   Detailed steps to reproduce the bug.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\n\u003c!-- prettier-ignore-start --\u003e\n\n\u003c!-- markdownlint-disable --\u003e\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://boidol.dev/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/652404?v=4?s=100\" width=\"100px;\" alt=\"Raphael Boidol\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRaphael Boidol\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tj-actions/sync-release-version/commits?author=boidolr\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj-actions%2Fsync-release-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftj-actions%2Fsync-release-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj-actions%2Fsync-release-version/lists"}