{"id":16775954,"url":"https://github.com/michmich112/version-bumper","last_synced_at":"2025-03-22T00:30:59.718Z","repository":{"id":39982707,"uuid":"252357903","full_name":"michmich112/version-bumper","owner":"michmich112","description":"Programatically bump versions in any project and define your versioning scheme as well as rules to control your versioning pipeline","archived":false,"fork":false,"pushed_at":"2023-07-18T22:11:44.000Z","size":37979,"stargazers_count":18,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T06:22:52.965Z","etag":null,"topics":["github-actions","semantic-versioning","version","version-control","version-control-system","version-manager","versioning","versions"],"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/michmich112.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":"2020-04-02T04:48:45.000Z","updated_at":"2024-11-15T04:24:54.000Z","dependencies_parsed_at":"2024-06-19T10:02:06.494Z","dependency_job_id":"21814d73-3244-4ac6-bf99-17d8ec9ae649","html_url":"https://github.com/michmich112/version-bumper","commit_stats":{"total_commits":101,"total_committers":7,"mean_commits":"14.428571428571429","dds":0.3267326732673267,"last_synced_commit":"ddb1e4b5e0450320fb77119279bcbe17916efd0d"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michmich112%2Fversion-bumper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michmich112%2Fversion-bumper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michmich112%2Fversion-bumper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michmich112%2Fversion-bumper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michmich112","download_url":"https://codeload.github.com/michmich112/version-bumper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890102,"owners_count":20527030,"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-actions","semantic-versioning","version","version-control","version-control-system","version-manager","versioning","versions"],"created_at":"2024-10-13T07:08:20.135Z","updated_at":"2025-03-22T00:30:55.313Z","avatar_url":"https://github.com/michmich112.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Version Bumper\n![total runs](https://actions.boringday.co/api/badge?owner=michmich112\u0026repo=version-bumper\u0026metric=runs)\n![runs per month](https://actions.boringday.co/api/badge?owner=michmich112\u0026repo=version-bumper\u0026metric=runs-per-month)\n![repos](https://actions.boringday.co/api/badge?owner=michmich112\u0026repo=version-bumper\u0026metric=repos)\n---\nGithub action that automatically bumps versions in selected files based on versioning scheme and rules.\n\nPlease create an issue if you have found a bug or wish for additional functionality.\n\n## Example Usage\nWith options file\n```yaml\nname: Manage versions\n\non: [push]\n\njobs:\n  bump:\n    runs-on: ubuntu-latest\n   \n    steps:\n      # Checkout action is required\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v1\n        with:\n          node-version: '12'\n      - name: Bump Versions\n        uses: michmich112/version-bumper@master\n        with:\n          options-file: './examples/example-options-full.json'\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nWithout options file\n\n```yaml\nname: Manage versions\n\non: [push, pull_request]\n\njobs:\n  bump:\n    runs-on: ubuntu-latest\n   \n    steps:\n      # Checkout action is required\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v1\n        with:\n          node-version: '12'\n      - name: Bump Versions\n        uses: michmich112/version-bumper@master\n        with:\n          scheme: semantic\n          username: DoomGuy\n          email: guy@doom.id\n          version-file: \"./package.json\"\n          files: \u003e\n            [\n              \"./package-lock.json\"\n            ] \n          rules: \u003e\n            [{\n              \"trigger\":\"commit\",\n              \"branch\": \"staging\",\n              \"suffix\": \"-beta\",\n              \"bump\":\"build\"\n            },{\n              \"trigger\": \"pull-request\",\n              \"destBranch\": \"main\",\n              \"suffix\": \"-rc\",\n              \"bump\": \"minor\",\n              \"tag\": true\n            }, {\n              \"trigger\":\"commit\",\n              \"branch\":\"release\",\n              \"bump\":\"major\",\n              \"tag\": true,\n              \"reset\":[\"minor\",\"build\"]\n            }]'\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## Configuration\n### Inputs/Parameters\n| Parameter       | Required  |\n|-----------------|-----------|\n| `options-file`  | false     |\n| `username`      | false     |\n| `email`         | false     |\n| `github-token`  | true      |\n| `scheme`        | true      |\n| `custom-scheme` | false     |\n| `skip`          | false     |\n| `version-file`  | true      |\n| `files`         | true      |\n| `rules`         | true      |\n\n\n### `options-file` (Optional)\nFile path to the options file containing run options. The options file must be JSON.\n\nExample usage:\n```yaml\noptions-file: './.github/version-bumper-options.json'\n```\n\n### `username` (Optional)\nUsername of the account to perform the version bump commit. Overrides the default of `VersionBumper`.\n\nExample usage:\n```yaml\nusernmae: VersionBumper\n```\n\n### `email` (Optional)\nEmail of the account to perform the version bump commit (if this email is linked to a github account, \ngithub will be able to identify the user an attribute the commit to them). Overrides the default.\n\nExample usage:\n```yaml\nemail: dev@boringday.co\n```\n\n### `github-token` (Required)\nRequired github token used for committing version updates.\n\nExample usage:\n```yaml\n# Action workflow provides a secret with a pre-authenticated token\ngithub-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n***\n\u003e Note: The following inputs are only required if they are not present in the options file or if you have not specified \n\u003e an options file. Workflow inputs will be used over options in the options file.\n\n### `scheme` (Required)\nVersioning scheme to use. Predefined schemes are:\n\n| Scheme       | Definition          |\n|--------------|---------------------|\n| semantic     | major.minor[.build] |\n| org_semantic | major.minor.build   |\n\nSubmit an issue to request additional predefined schemes.\n\nYou can define a custom scheme by using the `custom` scheme. \n\n### `custom-scheme` (Optional)\nCustom scheme to use. Required if scheme is `custom`.\n\nSchemes are defined with tags (e.g. major) separated by \none or more separators: `.,;:-_\u003e\u003c`.\\\nExample: `main.secondary-\u003epatch`\\\nYou can make elements optional by wrapping them in brackets.\\\nExample: `main.secondary[-\u003epatch]`.\\\nIf we have `main:1`, `secondary:0` ,`patch:0` the resulting version printout will be `1.0`.\\\nIf `patch:1` the resulting version printout will be `1.0-\u003e1`.\n\n\n### `skip` (Optional)\nAdds [SKIP] prefix to the commit message to prevent CI/CD build.\n\n### `version-file` (Required)\nFile path where the current version can be found.\n\nExample usages:\n``` yaml\n# First match will be used as the version. Both versions are equivalent\nversion-file: \"./package.json\"\nversion-file: \"{'path':'./package.json'}\"\n\n# Will use the match found on line 3\n# Fallback to initial match if no match is found on specified line\n# must be in stringified JSON form\nversion-file: \"{'path':'./package.json', 'line':3}\"\n```\n\n### `files` (Required)\nFiles where version should be updated. Must be a JSON stringified array. Searches for a match of the current version at \nat the specified line (if applicable).\nNo need to add the version-file.\\\nExample usages:\n``` yaml\n# First match will be used as the version except if line number is passed.\nfiles: \u003e\n  [\n    \"./file1.json\", \n    {\"path\":\"./file2.txt\"}, \n    {\"path\":\"./file3.yaml\", \"line\":5}\n  ]\n\n# No additional files\nfiles: '[]'\n```\n\n### `rules` (Required)\nVersion update rules: a JSON stringified array of bumping rules objects.\\\nRule type definition:\n```typescript\n/**\n * Predefine a rule for bumping version numbers based on:\n * - trigger :\n *      - commit: new commit on branch,\n *      - pull request: new pull request on branch,\n * - branch : branch regex which should trigger the rule\n */\ninterface BumpRule {\n    /**\n     * Optional branch on which the rule should take effect\n     * if no branch is passed the rule will take effect on every branch which triggers the workflow\n     */\n    branch?: string,\n\n    /**\n     * Optional destinatoin branch for which the rule should take effect\n     * This is primarily used for pull_request triggers. On commit triggers destBranch is automtically equal to the branch parameter\n     */\n    destBranch?: string,\n\n    /**\n     * What items in the version number need to be bumped\n     * precisely matches the tag items\n     */\n    bump?: string | string[],\n\n    /**\n     * Prefix to apply on the new version\n     */\n    prefix?: string,\n\n    /**\n     * Reset elements in the version number\n     * E.g\n     * With version desc = major.minor[.build] -\u003e current: 1.2.3\n     * set reset: ['build']\n     * =\u003e 1.2.0\n     */\n    reset?: string | string[]\n    \n    /**\n     * Indicate that this bump should add a tag to the commit with the new version number\n     * If multiple rules match the current run, only one of them needs to allow the tag for it to take effect\n     */\n    tag?: boolean,\n\n    /**\n     * Action that triggers the bump to occur\n     *    - commit: new commit on branch (includes the creation of a new branch),\n     *    - pull request: new pull request on branch (only when pr is Opened),\n     *    - manual: trigger the workflow manually using workflow_dispatch\n     * Note: your workflow must accept the 'push' event for the commit trigger and 'pull_request' event for pull-request trigger\n     * Note: your workflow must accept the 'workflow_dispatch' event to use the manual trigger\n     */\n    trigger: 'commit' | 'pull-request' | 'manual',\n\n    /**\n     * Suffix to apply on the new version\n     */\n    suffix?: string,\n}\n``` \nExample usage:\n```yaml\n# for semantic versioning i.e. scheme = major.minor[.build]\n# {\"trigger\":\"commit\",\"bump\":\"build\"} -\u003e bump the build tag on every commit on any branch\n# {\"trigger\": \"commit\", \"branch\": \"master\", \"bump\":\"minor\", \"reset\":\"build\"} -\u003e bump minor and reset build on every commit to master\n# {\"trigger\":\"commit\",\"branch\":\"release\",\"bump\":\"major\", \"reset\":[\"minor\",\"build\"]} -\u003e bump major on any commit to branch \"release\" and reset minor and build\nrules: \u003e\n  [{\n    \"trigger\":\"commit\",\n    \"bump\":\"build\"\n  }, {\n    \"trigger\": \"commit\", \n    \"branch\": \"master\",\n    \"bump\":\"minor\", \n    \"reset\":\"build\"\n  }, {\n    \"trigger\":\"commit\",\n    \"branch\":\"release\",\n    \"bump\":\"major\",\n    \"reset\":[\"minor\",\"build\"]\n  }]\n```\n\n\n## Options\nYou can find an example options file [here](https://github.com/michmich112/version-bumper/tree/master/examples/example-options-full.json)\nThe options file has the following available options:\n```typescript\ninterface BumperOptionsFile {\n    \n    // the scheme chosen, \n    // use 'custom' to use a custom scheme\n    scheme: string,  \n    \n    // use for custom scheme definitions\n    schemeDefinition?: string,\n\n    // Add the [SKIP] prefix to skip build\n    skip?: boolean,\n    \n    // path file containing the current version\n    // may include line if other possible matches\n    versionFile: string | {path: string, line:number},\n\n    // Array of paths to files containing the version to update\n    // may include line if other possible matches\n    files: ( string | {path: string, line:number} )[],\n\n    // Array of rule objects\n    rules: BumpRule[]\n}\n\ninterface BumpRule {\n\n    /**\n     * Optional branch on which the rule should take effect\n     */\n    branch?: string,\n\n    /**\n     * Optional destinatoin branch for which the rule should take effect\n     * This is primarily used for pull_request triggers. On commit triggers destBranch is automtically equal to the branch parameter\n     */\n    destBranch?: stirng,\n\n    /**\n     * What items in the version number need to be bumped\n     */\n    bump?: string | string[],\n  \n    /**\n     * Prefix to apply on the new version\n     */\n    prefix?: string,\n\n    /**\n     * Reset elements in the version number\n     * E.g\n     * With version desc = major.minor[.build] -\u003e current: 1.2.3\n     * set reset: ['build']\n     * =\u003e 1.2.0\n     */\n    reset?: string | string[],\n  \n    /**\n     * Suffix to apply on the new version\n     */\n    suffix?: string,\n\n    /**\n     * Indicate that this bump should add a tag to the commit with the new version number\n     * If multiple rules match the current run, only one of them needs to allow the tag for it to take effect\n     */\n    tag?: boolean,\n\n    /**\n     * Action that triggers the bump to occur\n     */\n    trigger: 'commit' | 'pull-request' | 'manual',\n\n}\n```\n\n# Contributors\nThank you to \n- [jamieleecho](https://github.com/jamieleecho)\n- [migueltarga](https://github.com/migueltarga)\n- [MarkIannucci](https://github.com/MarkIannucci)\n\nfor their help and contributions to the project!\n\n# Notes\nThis action uses the `gh-action-stats` package to track usage. See the data collected at [gh-action-stats-js](https://github.com/michmich112/gh-action-stats-js).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichmich112%2Fversion-bumper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichmich112%2Fversion-bumper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichmich112%2Fversion-bumper/lists"}