{"id":15658975,"url":"https://github.com/stefanzweifel/php-changelog-updater","last_synced_at":"2025-10-18T01:47:48.064Z","repository":{"id":38825555,"uuid":"393143802","full_name":"stefanzweifel/php-changelog-updater","owner":"stefanzweifel","description":"PHP CLI to add latest release notes to a CHANGELOG","archived":false,"fork":false,"pushed_at":"2025-05-05T14:25:00.000Z","size":182651,"stargazers_count":25,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-11T04:48:37.688Z","etag":null,"topics":["changelog","cli","php-cli"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/stefanzweifel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"stefanzweifel","custom":["https://buymeacoff.ee/3oQ64YW"]}},"created_at":"2021-08-05T18:55:20.000Z","updated_at":"2025-05-05T14:25:02.000Z","dependencies_parsed_at":"2023-02-14T10:31:02.325Z","dependency_job_id":"bf9d26f8-c664-4831-8a08-227a5a45b35d","html_url":"https://github.com/stefanzweifel/php-changelog-updater","commit_stats":{"total_commits":152,"total_committers":5,"mean_commits":30.4,"dds":0.5394736842105263,"last_synced_commit":"ac8936e94cbb37e14ed614017e06c00eda2e55e2"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanzweifel%2Fphp-changelog-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanzweifel%2Fphp-changelog-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanzweifel%2Fphp-changelog-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanzweifel%2Fphp-changelog-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanzweifel","download_url":"https://codeload.github.com/stefanzweifel/php-changelog-updater/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518961,"owners_count":21921082,"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":["changelog","cli","php-cli"],"created_at":"2024-10-03T13:14:32.014Z","updated_at":"2025-10-18T01:47:47.949Z","avatar_url":"https://github.com/stefanzweifel.png","language":"PHP","funding_links":["https://github.com/sponsors/stefanzweifel","https://buymeacoff.ee/3oQ64YW"],"categories":[],"sub_categories":[],"readme":"# changelog-updater\n\nA PHP CLI to update a changelog with the latest release notes.\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/wnx/changelog-updater.svg?style=flat-square)](https://packagist.org/packages/wnx/changelog-updater)\n[![Tests](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/run-tests.yml/badge.svg)](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/run-tests.yml)\n[![Check \u0026 fix styling](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/php-cs-fixer.yml)\n[![phpstan](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/phpstan.yml/badge.svg)](https://github.com/stefanzweifel/php-changelog-updater/actions/workflows/phpstan.yml)\n[![Total Downloads](https://img.shields.io/packagist/dt/wnx/changelog-updater.svg?style=flat-square)](https://packagist.org/packages/wnx/changelog-updater)\n\nWant to automate the process of updating your changelog with GitHub Actions? Checkout the [stefanzweifel/changelog-updater-action](https://github.com/stefanzweifel/changelog-updater-action) which does exactly that.\n\n*If your changelog follows the [\"Keep a Changelog\"](https://keepachangelog.com/) format and has a \"Unreleased\" heading in it, the CLI will update the link in and place the release notes below heading.*\n\n## Installation\n\nYou can install the changelog-updater CLI as a composer dependency in your project or globally. It requires PHP 8.2 or higher.\n\n```bash\ncomposer global require wnx/changelog-updater\n```\n\n## Usage\n\nYou can use `changelog-updater` by running the `update` command with the following options.\n\n```php\nphp changelog-updater update \\\n--release-notes=\"### Added\n- New Feature A\n- New Feature B\n\n### Changed\n- Update Feature C\n\n### Removes\n- Remove Feature D\" \\\n--latest-version=\"v1.0.0\" \\\n--release-date=\"2021-08-07\" \\\n--path-to-changelog=\"CHANGELOG.md\" \\\n--compare-url-target-revision=\"1.x\" \\\n--write\n```\n\n`--release-date`, `--path-to-changelog`, `--compare-url-target-revision` and `--write` are optional. Learn more about the options by running `php changelog-updater update --help`.\n\nIf a given version already exists in the CHANGELOG, the CLI will display a warning and not update the CHANGELOG.\n\n### CLI Options\n\n### `--release-notes`\n**Required**. The release notes you want to add to your changelog. Should be markdown.\n\n### `--latest-version`\n**Required**. Version number of the latest release. The value will be used as the heading text if `--heading-text` is not set. If the changelog has a \"Unreleased\" heading, the value will be used in the updated compare URL.\n\nExample: `v1.0.0`\n\n### `--release-date`\nOptional (Defaults to current date). The date the latest version has been released. The value will be used in the release heading.\n\n### `--path-to-changelog`\nOptional (Defaults to `CHANGELOG.md`). Path to CHANGELOG.md file.\n\n### `--compare-url-target-revision`\nOptional (Defaults to `HEAD`). If the changelog has a \"Unreleased\" heading, the value will be used together with the `--latest-version` value in the updated compare URL.\n\n### `--write`\nOptional. Write the changes to `CHANGELOG.md` or to the value of `--path-to-changelog`.\n\n### `--github-actions-output`\nOptional. Will output values for `UNRELEASED_COMPARE_URL` and `RELEASE_COMPARE_URL` that can be picked up by GitHub Actions and further used in ones Workflow. \n\n### `--heading-text`\nOptional (Defaults to value of `--latest-version`). The text value used in the heading that is created for the new release. \n\n```md\n## heading-text - 2021-02-01\n## [heading-text](https://github.com/org/repo/compare/v0.1.0...v1.0.0) - 2021-02-01\n```\n\n### `--parse-release-notes`\nOptional. Tell the CLI explicitly to use the content between an \"Unreleased Heading\" and the previous version heading as release notes. The value from `--release-notes` will be ignored.\n\n### `--hide-release-date`\nOptional. Don't add the release date to the release heading.\n\n### `--parse-github-usernames`\nOptional. Look for GitHub usernames in `--release-notes` and linkify them. Currently not supported for release notes that are located in the existing changelog.\n\n```diff\n- Added a new feature @stefanzweifel\n+ Added a new feature [@stefanzweifel](https://github.com/stefanzweifel)\n```\n\n## Expected Changelog Formats\n\nThe CLI does its best to place the given release notes in the right place. \nThe CLI looks for the first second level heading in your current `CHANGELOG.md` file. It assumes that this heading represents the previous version. Here is an example of a `CHANGELOG.md` that the CLI can understand.\n\n```\n# Changelog\n\n## v1.0.0 - 2021-11-01\n\n### Added\n- Initial Release\n```\n\nThe CLI will then place the new version and its release notes **above** the existing versions.\n\n```diff\n# Changelog\n\n+ ## v1.1.0 - 2021-11-10\n+ \n+ ### Added\n+ \n+ * New Feature\n+ \n## v1.0.0 - 2021-11-01\n\n### Added\n\n* Initial Release\n```\n\nIf the changelog does not contain a second level heading, it considers the changelog to be \"empty\". It will then place the release notes at the bottom of the document.\n\n```diff\n# Changelog\nAll notable changes to this project will be documented in this file.\n\n+## v1.0.0 - 2021-11-01\n+\n+### Added\n+\n+* Initial Release\n```\n\n---\n\nIf your changelog follows the [\"Keep a Changelog\"](https://keepachangelog.com/) format and contains an \"Unreleased\"-heading with a link to the repository compare view, the CLI will automatically update the link in the Unreleased heading.\n\nHere is an example of a changelog, before it is updated with the CLI.\n\n```\n# Changelog\n\n## [Unreleased](https://github.com/org/repo/compare/v1.0.0...HEAD)\n\nPlease do not update the unreleased notes.\n\n\u003c!-- Content should be placed here --\u003e\n\n## v1.0.0 - 2021-01-01\n\n### Added\n- Initial Release\n```\n\nBelow you find a diff-view of how the CLI will update the changelog.\n\n```diff\n# Changelog\n\n+## [Unreleased](https://github.com/org/repo/compare/v1.1.0...HEAD)\n-## [Unreleased](https://github.com/org/repo/compare/v1.0.0...HEAD)\n\nPlease do not update the unreleased notes.\n\n\u003c!-- Content should be placed here --\u003e\n+## [v1.1.0](https://github.com/org/repo/compare/v1.0.0...v1.1.0) - 2021-02-01\n+\n+### Added\n+\n+* New Feature A\n+* New Feature B\n+\n\n## v1.0.0 - 2021-01-01\n\n### Added\n* Initial Release\n```\n\nThe content between the \"Unreleased\"-heading and the latest version will remain untouched by the CLI.\n\n---\n\nIf you don't have a \"Unreleased\"-heading in your changelog, but the headings of your previous releases contain a link to the repository compare view, the CLI will add links to the compare view to the added release heading.\n\n```diff\n# Changelog\n\n+## [v1.1.0](https://github.com/org/repo/compare/v1.0.0...v1.1.0) - 2021-02-01\n+\n+### Added\n+\n+* New Feature A\n+* New Feature B\n+\n\n## [v1.0.0](https://github.com/org/repo/compare/v0.1.0...v1.0.0) - 2021-01-01\n\n### Added\n* Initial Release\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Stefan Zweifel](https://github.com/stefanzweifel)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanzweifel%2Fphp-changelog-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanzweifel%2Fphp-changelog-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanzweifel%2Fphp-changelog-updater/lists"}