{"id":13492483,"url":"https://github.com/metcalfc/changelog-generator","last_synced_at":"2025-05-15T08:10:31.279Z","repository":{"id":37802860,"uuid":"250708774","full_name":"metcalfc/changelog-generator","owner":"metcalfc","description":"GitHub Action to generate changelogs, release notes, whatever","archived":false,"fork":false,"pushed_at":"2025-04-06T08:01:36.000Z","size":2365,"stargazers_count":141,"open_issues_count":0,"forks_count":33,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T03:15:17.531Z","etag":null,"topics":["changelogs","cicd","github-actions","release-notes"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/metcalfc.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.sh","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-28T03:48:01.000Z","updated_at":"2025-04-06T08:01:26.000Z","dependencies_parsed_at":"2024-02-16T20:27:52.762Z","dependency_job_id":"f31197b7-66ec-412e-9496-15ae1eab1667","html_url":"https://github.com/metcalfc/changelog-generator","commit_stats":{"total_commits":288,"total_committers":6,"mean_commits":48.0,"dds":0.5729166666666667,"last_synced_commit":"bb02ee3ec9aa7df37601f691c037e20409734c7f"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metcalfc%2Fchangelog-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metcalfc%2Fchangelog-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metcalfc%2Fchangelog-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metcalfc%2Fchangelog-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metcalfc","download_url":"https://codeload.github.com/metcalfc/changelog-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799955,"owners_count":21163404,"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":["changelogs","cicd","github-actions","release-notes"],"created_at":"2024-07-31T19:01:06.459Z","updated_at":"2025-04-14T13:43:50.420Z","avatar_url":"https://github.com/metcalfc.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Community Resources"],"sub_categories":["GitHub Tools and Management"],"readme":"# Get a changelog between two references\n\nThis Action returns a markdown formatted changelog between two git references. There are other projects that use milestones, labeled PRs, etc. Those are just too much work for simple projects.\n\nI just wanted a simple way to populate the body of a GitHub Release.\n\n\u003ca href=\"https://github.com/metcalfc/changelog-generator/releases/tag/v4.6.2\"\u003e\u003cimg alt=\"Example Release Notes\" src=\"./release-notes.png\" width=\"400\"\u003e\u003c/a\u003e\n\n## Inputs\n\n### `mytoken`\n\nA GITHUB_TOKEN with the ability to pull from the repo in question. This is required.\n\nWhy do we need `myToken`? Read more here: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret\n\n### `head-ref`\n\nThe name of the head reference. Default `${{github.sha}}`.\n\n### `base-ref`\n\nThe name of the second branch. Defaults to the `tag_name` of the latest GitHub release. *This must be a GitHub release. Git tags or branches will not work.*\n\n### `reverse`\n\nWhether the order of commits should be printed in reverse. Default: 'false'\n\n### `fetch`\n\nWhether this action should pull in all other branches and tags. Default: 'true'\n\n## Outputs\n\n### `changelog`\n\nMarkdown formatted changelog.\n\n## Example usage\n\nThere are two blocks you will need:\n\n### First block\n\nFirst you will need to generate the changelog itself. To get the changelog between the SHA of the commit that triggered the action and the tag of the latest release:\n\n```yaml\n- name: Generate changelog\n  id: changelog\n  uses: metcalfc/changelog-generator@v4.6.2\n  with:\n    myToken: ${{ secrets.GITHUB_TOKEN }}\n```\n\nOr, if you have two specific references you want:\n\n```yaml\n- name: Generate changelog\n  id: changelog\n  uses: metcalfc/changelog-generator@v4.6.2\n  with:\n    myToken: ${{ secrets.GITHUB_TOKEN }}\n    head-ref: 'v0.0.2'\n    base-ref: 'v0.0.1'\n```\n\nIf you want to point to a branch containing forward slashes (https://github.com/metcalfc/changelog-generator/issues/179) do the following:\n\n```yaml\n\n# let the checkout action do the fetching\n- uses: actions/checkout@v3\n  with:\n    fetch-depth: 0\n\n- name: Generate changelog\n  id: changelog\n  uses: metcalfc/changelog-generator@v4.6.2 #TODO: bump this after release\n  with:\n    myToken: ${{ secrets.GITHUB_TOKEN }}\n    head-ref: 'origin/my/branch/with/slashes' #add 'origin/` in front of your branch name\n    base-ref: 'v4.6.2'\n    fetch: false\n```\n\n### Second block\n\nThen you can use the resulting changelog:\n\n```yaml\n- name: Get the changelog\n  run: |\n    cat \u003c\u003c \"EOF\"\n    ${{ steps.changelog.outputs.changelog }}\n    EOF\n```\n\n### Simple output modifications\n\nSome folks have asked if the action can support changing the output. For example:\n  * Reverse order *UPDATE* as of 2021/11/22 chronological is the default and it can be reversed by setting `reverse: 'true'` in the workflow.\n  * Ignore entries that include this string.\n  * Etc\n\nIn order to keep this action as simple as possible we aren't planning to add more flags or options. However since the output is just text you can write a command line to do anything you want. In issue #93 we had a user that wanted to list the changelog in reverse order and drop any entries with `gh-pages`. Here is how they can do that but using Bumping as the restrict word because it shows up in this projects history:\n\n```yaml\n      - name: Modify the changelog\n        id: modified\n        run: |\n          set -o noglob\n          log=$(cat \u003c\u003c \"EOF\" | grep -v Bumping | tac\n          ${{ steps.changelog.outputs.changelog }}\n          EOF\n          )\n          log=\"${log//'%'/'%25'}\"\n          log=\"${log//$'\\n'/'%0A'}\"\n          log=\"${log//$'\\r'/'%0D'}\"\n          echo \"log=$log\" \u003e\u003e $GITHUB_OUTPUT\n\n      - name: Print the modified changelog\n        run: |\n          cat \u003c\u003c \"EOF\"\n          ${{ steps.modified.outputs.log }}\n          EOF\n```\n\nYou might be wondering about that set of escaping for the `log`. Thats because GitHub Actions doesn't support multiline output. Read more [here](https://github.community/t/set-output-truncates-multiline-strings/16852).\n\n## Example use case\n\n[Generating the release notes for a GitHub Release.](.github/workflows/release.yml)\n\n## Open Discussions for feature requests or questions\n\nIssues are for folks who are actively using the action and running into an \"issue\" (bug, missing doc, etc).\n\nFeature requests should be in the [discussion section.](https://github.com/metcalfc/changelog-generator/discussions).\nJust to set expectations the bar for a new feature getting added is going to be very high. There is a\ncost to adding features in the development and maintainance of the feature. So if you want to jump in and\nhelp develop and maintain lets discuss. If you want to fire off feature ideas, go for it. Just understand its\nvery likely that without someone willing to take up the task, they won't get implemented.\n\n## Keep up-to-date with GitHub Dependabot\n\nSince [Dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot)\nhas [native GitHub Actions support](https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem),\nto enable it on your GitHub repo all you need to do is add the `.github/dependabot.yml` file:\n\n```yaml\nversion: 2\nupdates:\n  # Maintain dependencies for GitHub Actions\n  - package-ecosystem: 'github-actions'\n    directory: '/'\n    schedule:\n      interval: 'daily'\n```\n## Troubleshooting\n\n### Error not found\n\n```\nError: Not Found\n```\n\nIf you are seeing this error its likely that you do not yet have a GitHub release. You might have a git tag and that shows up in the release tab. The\nAPI this Action uses only works with GitHub Releases. Convert one of your tags to a release and you'll be on your way. You can check out how this\nrepository uses this action and GitHub releases for an [example](.github/workflows/release.yml).\n\n\n## Acknowledgements\n\nI took the basic framework for this action from: [jessicalostinspace/commit-difference-action](https://github.com/jessicalostinspace/commit-difference-action). Thanks @jessicalostinspace.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetcalfc%2Fchangelog-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetcalfc%2Fchangelog-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetcalfc%2Fchangelog-generator/lists"}