├── .gitignore ├── Dockerfile ├── .github ├── dependabot.yml └── workflows │ ├── release.yml │ └── ci.yml ├── LICENSE ├── README.md ├── action.yml └── entrypoint.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM githubchangeloggenerator/github-changelog-generator:1.16.2 2 | 3 | # Install bash. 4 | RUN apk add --no-cache bash 5 | 6 | COPY entrypoint.sh /entrypoint.sh 7 | RUN chmod +x /entrypoint.sh 8 | ENTRYPOINT ["/entrypoint.sh"] 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: docker 4 | directory: / 5 | schedule: 6 | interval: weekly 7 | - package-ecosystem: github-actions 8 | directory: / 9 | schedule: 10 | interval: monthly 11 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Create release 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 7 | 8 | jobs: 9 | build: 10 | name: "🚀 Release" 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: "📥 Check-out" 14 | uses: actions/checkout@v5 15 | - name: "✏️ Generate release changelog" 16 | id: generate-release-changelog 17 | uses: ./ 18 | with: 19 | token: ${{ secrets.GITHUB_TOKEN }} 20 | onlyLastTag: "true" 21 | stripHeaders: "true" 22 | stripGeneratorNotice: "true" 23 | - name: "🚀 Create GitHub release" 24 | uses: actions/create-release@v1 25 | env: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | with: 28 | tag_name: ${{ github.ref }} 29 | release_name: Release ${{ github.ref }} 30 | body: ${{ steps.generate-release-changelog.outputs.changelog }} 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jan Heinrich Reimer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: push 4 | 5 | jobs: 6 | build: 7 | name: "✏️ Changelog generation" 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: "📥 Check-out" 11 | uses: actions/checkout@v5 12 | - name: "✏️ Generate full changelog" 13 | id: generate-full-changelog 14 | uses: ./ 15 | with: 16 | token: ${{ secrets.GITHUB_TOKEN }} 17 | headerLabel: "# 📑 Changelog" 18 | breakingLabel: '### 💥 Breaking' 19 | enhancementLabel: '### 🚀 Enhancements' 20 | bugsLabel: '### 🐛 Bug fixes' 21 | deprecatedLabel: '### ⚠️ Deprecations' 22 | removedLabel: '### 🔥 Removals' 23 | securityLabel: '### 🛡️ Security' 24 | issuesLabel: '### 📁 Other issues' 25 | prLabel: '### 📁 Other pull requests' 26 | addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["documentation"]},"tests":{"prefix":"### ✅ Testing","labels":["tests"]}}' 27 | issues: true 28 | issuesWoLabels: true 29 | pullRequests: true 30 | prWoLabels: true 31 | author: true 32 | unreleased: true 33 | compareLink: true 34 | stripGeneratorNotice: true 35 | verbose: true 36 | - name: "🖨️ Print changelog to console" 37 | run: cat CHANGELOG.md 38 | - name: "📤 Upload changelog" 39 | uses: actions/upload-artifact@v4 40 | with: 41 | name: "Changelog" 42 | path: CHANGELOG.md 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License](https://img.shields.io/github/license/janheinrichmerker/action-github-changelog-generator.svg?style=flat-square)](LICENSE) 2 | [![Last commit](https://img.shields.io/github/last-commit/janheinrichmerker/action-github-changelog-generator.svg?style=flat-square)](https://github.com/janheinrichmerker/action-github-changelog-generator/commits) 3 | [![Latest tag](https://img.shields.io/github/tag/janheinrichmerker/action-github-changelog-generator.svg?style=flat-square)](https://github.com/janheinrichmerker/action-github-changelog-generator/releases) 4 | [![Issues](https://img.shields.io/github/issues/janheinrichmerker/action-github-changelog-generator.svg?style=flat-square)](https://github.com/janheinrichmerker/action-github-changelog-generator/issues) 5 | [![Pull requests](https://img.shields.io/github/issues-pr/janheinrichmerker/action-github-changelog-generator.svg?style=flat-square)](https://github.com/janheinrichmerker/action-github-changelog-generator/pulls) 6 | 7 | # ✏️ action-github-changelog-generator 8 | 9 | Automatically generate change log from your tags, issues, labels and pull requests on GitHub, 10 | using [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator)'s 11 | [Docker image](https://github.com/github-changelog-generator/docker-github-changelog-generator). 12 | 13 | This action also makes the changelog available to other actions as [output](#outputs). 14 | 15 | ## Example usage 16 | 17 | ```yaml 18 | name: Changelog 19 | on: 20 | release: 21 | types: 22 | - created 23 | jobs: 24 | changelog: 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: "✏️ Generate release changelog" 28 | uses: janheinrichmerker/action-github-changelog-generator@v2.3 29 | with: 30 | token: ${{ secrets.GITHUB_TOKEN }} 31 | ``` 32 | 33 | ## Inputs 34 | 35 | | Name | Description | Default | 36 | |---|---|---| 37 | | `repo` | Target GitHub repo in the form of organization/repository. | [inherit] | 38 | | `user` | Username of the owner of target GitHub repo. | [inherit] | 39 | | `project` | Name of project on GitHub. | [inherit] | 40 | | `token` | To make more than 50 requests per hour your GitHub token is required. | [inherit] | 41 | | `dateFormat` | Date format. | [inherit] | 42 | | `output` | Output file. | [inherit] | 43 | | `base` | Optional base file to append generated changes to. | [inherit] | 44 | | `headerLabel` | Set up custom header label. | [inherit] | 45 | | `configureSections` | Define your own set of sections which overrides all default sections. | [inherit] | 46 | | `addSections` | Add new sections but keep the default sections. | [inherit] | 47 | | `frontMatter` | Add YAML front matter. Formatted as JSON because it's easier to add on the command line. | [inherit] | 48 | | `issues` | Include closed issues in changelog. | [inherit] | 49 | | `issuesWoLabels` | Include closed issues without labels in changelog. | [inherit] | 50 | | `pullRequests` | Include pull-requests in changelog. | [inherit] | 51 | | `prWoLabels` | Include pull requests without labels in changelog. | [inherit] | 52 | | `filterByMilestone` | Use milestone to detect when issue was resolved. | [inherit] | 53 | | `author` | Add author of pull request at the end. | [inherit] | 54 | | `usernamesAsGithubLogins` | Use GitHub tags instead of Markdown links for the author of an issue or pull-request. | [inherit] | 55 | | `unreleasedOnly` | Generate log from unreleased closed issues only. | [inherit] | 56 | | `unreleased` | Add to log unreleased closed issues. | [inherit] | 57 | | `unreleasedLabel` | Set up custom label for unreleased closed issues section. | [inherit] | 58 | | `compareLink` | Include compare link (Full Changelog) between older version and newer version. | [inherit] | 59 | | `includeLabels` | Of the labeled issues, only include the ones with the specified labels. | [inherit] | 60 | | `excludeLabels` | Issues with the specified labels will be excluded from changelog. | [inherit] | 61 | | `issueLineLabels` | The specified labels will be shown in brackets next to each matching issue. Use "ALL" to show all labels. | [inherit] | 62 | | `excludeTags` | Changelog will exclude specified tags. | [inherit] | 63 | | `excludeTagsRegex` | Apply a regular expression on tag names so that they can be excluded. | [inherit] | 64 | | `sinceTag` | Changelog will start after specified tag. | [inherit] | 65 | | `dueTag` | Changelog will end before specified tag. | [inherit] | 66 | | `maxIssues` | Maximum number of issues to fetch from GitHub. | [inherit] | 67 | | `releaseUrl` | The URL to point to for release links, in printf format (with the tag as variable). | [inherit] | 68 | | `githubSite` | The Enterprise GitHub site where your project is hosted. | [inherit] | 69 | | `githubApi` | The enterprise endpoint to use for your GitHub API. | [inherit] | 70 | | `simpleList` | Create a simple list from issues and pull requests. | [inherit] | 71 | | `futureRelease` | Put the unreleased changes in the specified release number. | [inherit] | 72 | | `releaseBranch` | Limit pull requests to the release branch, such as master or release. | [inherit] | 73 | | `httpCache` | Use HTTP Cache to cache GitHub API requests (useful for large repos). | [inherit] | 74 | | `cacheFile` | Filename to use for cache. | [inherit] | 75 | | `cacheLog` | Filename to use for cache log. | [inherit] | 76 | | `sslCaFile` | Path to cacert.pem file. | [inherit] | 77 | | `verbose` | Run verbosely. | [inherit] | 78 | | `breakingLabel` | Set up custom label for breaking changes section. | [inherit] | 79 | | `breakingLabels` | Issues with these labels will be added to a new section, called "Breaking changes". | [inherit] | 80 | | `enhancementLabel` | Set up custom label for enhancements section. | [inherit] | 81 | | `enhancementLabels` | Issues with the specified labels will be added to "Implemented enhancements" section. | [inherit] | 82 | | `bugsLabel` | Set up custom label for bug-fixes section. | [inherit] | 83 | | `bugLabels` | Issues with the specified labels will be added to "Fixed bugs" section. | [inherit] | 84 | | `deprecatedLabel` | Set up custom label for deprecated section. | [inherit] | 85 | | `deprecatedLabels` | Issues with the specified labels will be added to a section called "Deprecated". | [inherit] | 86 | | `removedLabel` | Set up custom label for removed section. | [inherit] | 87 | | `removedLabels` | Issues with the specified labels will be added to a section called "Removed". | [inherit] | 88 | | `securityLabel` | Set up custom label for security section. | [inherit] | 89 | | `securityLabels` | Issues with the specified labels will be added to a section called "Security fixes". | [inherit] | 90 | | `issuesLabel` | Set up custom label for closed-issues section. | [inherit] | 91 | | `prLabel` | Set up custom label for pull requests section. | [inherit] | 92 | | `onlyLastTag` | Changelog will only show last tag. | `false` | 93 | | `stripHeaders` | Strip headers and only show changes. | `false` | 94 | | `stripGeneratorNotice` | Strip generator notice. | `false` | 95 | 96 | Most inputs inherit their defaults from 97 | [github-changelog-generator][inherit]. 98 | 99 | ## Outputs 100 | 101 | | Name | Description | 102 | |---|---| 103 | | `changelog` | Contents of generated change log. | 104 | 105 | [inherit]: https://github.com/github-changelog-generator/github-changelog-generator/wiki/Advanced-change-log-generation-examples#additional-options "Inherited from github-changelog-generator." 106 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Generate changelog" 2 | description: "Automatically generate change log from your tags, issues, labels and pull requests on GitHub." 3 | branding: 4 | icon: edit 5 | color: orange 6 | inputs: 7 | repo: 8 | description: "Target GitHub repo in the form of organization/repository." 9 | required: false 10 | user: 11 | description: "Username of the owner of target GitHub repo." 12 | required: false 13 | project: 14 | description: "Name of project on GitHub." 15 | required: false 16 | token: 17 | description: "To make more than 50 requests per hour your GitHub token is required." 18 | required: false 19 | dateFormat: 20 | description: "Date format." 21 | required: false 22 | output: 23 | description: "Output file." 24 | required: false 25 | base: 26 | description: "Optional base file to append generated changes to." 27 | required: false 28 | headerLabel: 29 | description: "Set up custom header label." 30 | required: false 31 | configureSections: 32 | description: "Define your own set of sections which overrides all default sections." 33 | required: false 34 | addSections: 35 | description: "Add new sections but keep the default sections." 36 | required: false 37 | frontMatter: 38 | description: "Add YAML front matter. Formatted as JSON because it's easier to add on the command line." 39 | required: false 40 | issues: 41 | description: "Include closed issues in changelog." 42 | required: false 43 | issuesWoLabels: 44 | description: "Include closed issues without labels in changelog." 45 | required: false 46 | pullRequests: 47 | description: "Include pull-requests in changelog." 48 | required: false 49 | prWoLabels: 50 | description: "Include pull requests without labels in changelog." 51 | required: false 52 | filterByMilestone: 53 | description: "Use milestone to detect when issue was resolved." 54 | required: false 55 | author: 56 | description: "Add author of pull request at the end." 57 | required: false 58 | usernamesAsGithubLogins: 59 | description: "Use GitHub tags instead of Markdown links for the author of an issue or pull-request." 60 | required: false 61 | unreleasedOnly: 62 | description: "Generate log from unreleased closed issues only." 63 | required: false 64 | unreleased: 65 | description: "Add to log unreleased closed issues." 66 | required: false 67 | unreleasedLabel: 68 | description: "Set up custom label for unreleased closed issues section." 69 | required: false 70 | compareLink: 71 | description: "Include compare link (Full Changelog) between older version and newer version." 72 | required: false 73 | includeLabels: 74 | description: "Of the labeled issues, only include the ones with the specified labels." 75 | required: false 76 | excludeLabels: 77 | description: "Issues with the specified labels will be excluded from changelog." 78 | required: false 79 | issueLineLabels: 80 | description: "The specified labels will be shown in brackets next to each matching issue. Use \"ALL\" to show all labels." 81 | required: false 82 | excludeTags: 83 | description: "Changelog will exclude specified tags." 84 | required: false 85 | excludeTagsRegex: 86 | description: "Apply a regular expression on tag names so that they can be excluded." 87 | required: false 88 | sinceTag: 89 | description: "Changelog will start after specified tag." 90 | required: false 91 | dueTag: 92 | description: "Changelog will end before specified tag." 93 | required: false 94 | maxIssues: 95 | description: "Maximum number of issues to fetch from GitHub." 96 | required: false 97 | releaseUrl: 98 | description: "The URL to point to for release links, in printf format (with the tag as variable)." 99 | required: false 100 | githubSite: 101 | description: "The Enterprise GitHub site where your project is hosted." 102 | required: false 103 | githubApi: 104 | description: "The enterprise endpoint to use for your GitHub API." 105 | required: false 106 | simpleList: 107 | description: "Create a simple list from issues and pull requests." 108 | required: false 109 | futureRelease: 110 | description: "Put the unreleased changes in the specified release number." 111 | required: false 112 | releaseBranch: 113 | description: "Limit pull requests to the release branch, such as master or release." 114 | required: false 115 | httpCache: 116 | description: "Use HTTP Cache to cache GitHub API requests (useful for large repos)." 117 | required: false 118 | cacheFile: 119 | description: "Filename to use for cache." 120 | required: false 121 | cacheLog: 122 | description: "Filename to use for cache log." 123 | required: false 124 | sslCaFile: 125 | description: "Path to cacert.pem file." 126 | required: false 127 | # require: # excluded 128 | verbose: 129 | description: "Run verbosely." 130 | required: false 131 | # version: # excluded 132 | # help: # excluded 133 | breakingLabel: 134 | description: "Set up custom label for breaking changes section." 135 | required: false 136 | breakingLabels: 137 | description: "Issues with these labels will be added to a new section, called \"Breaking changes\"." 138 | required: false 139 | enhancementLabel: 140 | description: "Set up custom label for enhancements section." 141 | required: false 142 | enhancementLabels: 143 | description: "Issues with the specified labels will be added to \"Implemented enhancements\" section." 144 | required: false 145 | bugsLabel: 146 | description: "Set up custom label for bug-fixes section." 147 | required: false 148 | bugLabels: 149 | description: "Issues with the specified labels will be added to \"Fixed bugs\" section." 150 | required: false 151 | deprecatedLabel: 152 | description: "Set up custom label for deprecated section." 153 | required: false 154 | deprecatedLabels: 155 | description: "Issues with the specified labels will be added to a section called \"Deprecated\"." 156 | required: false 157 | removedLabel: 158 | description: "Set up custom label for removed section." 159 | required: false 160 | removedLabels: 161 | description: "Issues with the specified labels will be added to a section called \"Removed\"." 162 | required: false 163 | securityLabel: 164 | description: "Set up custom label for security section." 165 | required: false 166 | securityLabels: 167 | description: "Issues with the specified labels will be added to a section called \"Security fixes\"." 168 | required: false 169 | issuesLabel: 170 | description: "Set up custom label for closed-issues section." 171 | required: false 172 | prLabel: 173 | description: "Set up custom label for pull requests section." 174 | required: false 175 | onlyLastTag: 176 | description: "Changelog will only show last tag." 177 | required: false 178 | stripHeaders: 179 | description: "Strip headers." 180 | required: false 181 | stripGeneratorNotice: 182 | description: "Strip generator reference." 183 | required: false 184 | outputs: 185 | changelog: 186 | description: "Contents of generated change log." 187 | runs: 188 | using: "docker" 189 | image: "Dockerfile" 190 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | istrue () { 3 | case $1 in 4 | "true"|"yes"|"y") return 0;; 5 | *) return 1;; 6 | esac 7 | } 8 | 9 | set -e 10 | 11 | # Go to GitHub workspace. 12 | if [ -n "$GITHUB_WORKSPACE" ]; then 13 | cd "$GITHUB_WORKSPACE" || exit 14 | fi 15 | 16 | # Set repository from GitHub, if not set. 17 | if [ -z "$INPUT_REPO" ]; then INPUT_REPO="$GITHUB_REPOSITORY"; fi 18 | # Set user input from repository, if not set. 19 | if [ -z "$INPUT_USER" ]; then INPUT_USER=$(echo "$INPUT_REPO" | cut -d / -f 1 ); fi 20 | # Set project input from repository, if not set. 21 | if [ -z "$INPUT_PROJECT" ]; then INPUT_PROJECT=$(echo "$INPUT_REPO" | cut -d / -f 2- ); fi 22 | 23 | 24 | # Only show last tag. 25 | if istrue "$INPUT_ONLYLASTTAG"; then 26 | INPUT_DUETAG="" 27 | INPUT_SINCETAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1)) 28 | fi 29 | 30 | # Build arguments. 31 | if [ -n "$INPUT_USER" ]; then ARG_USER="--user $INPUT_USER"; fi 32 | if [ -n "$INPUT_PROJECT" ]; then ARG_PROJECT="--project $INPUT_PROJECT"; fi 33 | if [ -n "$INPUT_TOKEN" ]; then ARG_TOKEN="--token $INPUT_TOKEN"; fi 34 | if [ -n "$INPUT_DATEFORMAT" ]; then ARG_DATEFORMAT="--date-format $INPUT_DATEFORMAT"; fi 35 | if [ -n "$INPUT_OUTPUT" ]; then ARG_OUTPUT="--output $INPUT_OUTPUT"; fi 36 | if [ -n "$INPUT_BASE" ]; then ARG_BASE="--base $INPUT_BASE"; fi 37 | if [ -n "$INPUT_HEADERLABEL" ]; then ARG_HEADERLABEL=(--header-label "$INPUT_HEADERLABEL"); fi 38 | if [ -n "$INPUT_CONFIGURESECTIONS" ]; then ARG_CONFIGURESECTIONS=(--configure-sections "$INPUT_CONFIGURESECTIONS"); fi 39 | if [ -n "$INPUT_ADDSECTIONS" ]; then ARG_ADDSECTIONS=(--add-sections "$INPUT_ADDSECTIONS"); fi 40 | if [ -n "$INPUT_FRONTMATTER" ]; then ARG_FRONTMATTER=(--front-matter "$INPUT_FRONTMATTER"); fi 41 | if [[ -n $INPUT_ISSUES ]]; then if istrue "$INPUT_ISSUES"; then ARG_ISSUES="--issues"; else ARG_ISSUES="--no-issues"; fi; fi 42 | if [[ -n $INPUT_ISSUESWOLABELS ]]; then if istrue "$INPUT_ISSUESWOLABELS"; then ARG_ISSUESWOLABELS="--issues-wo-labels"; else ARG_ISSUESWOLABELS="--no-issues-wo-labels"; fi; fi 43 | if [[ -n $INPUT_PULLREQUESTS ]]; then if istrue "$INPUT_PULLREQUESTS"; then ARG_PULLREQUESTS="--pull-requests"; else ARG_PULLREQUESTS="--no-pull-requests"; fi; fi 44 | if [[ -n $INPUT_PRWOLABELS ]]; then if istrue "$INPUT_PRWOLABELS"; then ARG_PRWOLABELS="--pr-wo-labels"; else ARG_PRWOLABELS="--no-pr-wo-labels"; fi; fi 45 | if [[ -n $INPUT_FILTERBYMILESTONE ]]; then if istrue "$INPUT_FILTERBYMILESTONE"; then ARG_FILTERBYMILESTONE="--filter-by-milestone"; else ARG_FILTERBYMILESTONE="--no-filter-by-milestone"; fi; fi 46 | if [[ -n $INPUT_AUTHOR ]]; then if istrue "$INPUT_AUTHOR"; then ARG_AUTHOR="--author"; else ARG_AUTHOR="--no-author"; fi; fi 47 | if [[ -n $INPUT_USERNAMESASGITHUBLOGINS ]]; then if istrue "$INPUT_USERNAMESASGITHUBLOGINS"; then ARG_USERNAMESASGITHUBLOGINS="--usernames-as-github-logins"; fi; fi 48 | if [[ -n $INPUT_UNRELEASEDONLY ]]; then if istrue "$INPUT_UNRELEASEDONLY"; then ARG_UNRELEASEDONLY="--unreleased-only"; fi; fi 49 | if [[ -n $INPUT_UNRELEASED ]]; then if istrue "$INPUT_UNRELEASED"; then ARG_UNRELEASED="--unreleased"; else ARG_ISSUES="--no-unreleased"; fi; fi 50 | if [ -n "$INPUT_UNRELEASEDLABEL" ]; then ARG_UNRELEASEDLABEL=(--unreleased-label "$INPUT_UNRELEASEDLABEL"); fi 51 | if [[ -n $INPUT_COMPARELINK ]]; then if istrue "$INPUT_COMPARELINK"; then ARG_COMPARELINK="--compare-link"; else ARG_COMPARELINK="--no-compare-link"; fi; fi 52 | if [ -n "$INPUT_INCLUDELABELS" ]; then ARG_INCLUDELABELS=(--include-labels "$INPUT_INCLUDELABELS"); fi 53 | if [ -n "$INPUT_EXCLUDELABELS" ]; then ARG_EXCLUDELABELS=(--exclude-labels "$INPUT_EXCLUDELABELS"); fi 54 | if [ -n "$INPUT_ISSUELINELABELS" ]; then ARG_ISSUELINELABELS=(--issue-line-labels "$INPUT_ISSUELINELABELS"); fi 55 | if [ -n "$INPUT_EXCLUDETAGS" ]; then ARG_EXCLUDETAGS=(--exclude-tags "$INPUT_EXCLUDETAGS"); fi 56 | if [ -n "$INPUT_EXCLUDETAGSREGEX" ]; then ARG_EXCLUDETAGSREGEX=(--exclude-tags-regex "$INPUT_EXCLUDETAGSREGEX"); fi 57 | if [ -n "$INPUT_SINCETAG" ]; then ARG_SINCETAG="--since-tag $INPUT_SINCETAG"; fi 58 | if [ -n "$INPUT_DUETAG" ]; then ARG_DUETAG="--due-tag $INPUT_DUETAG"; fi 59 | if [ -n "$INPUT_MAXISSUES" ]; then ARG_MAXISSUES="--max-issues $INPUT_MAXISSUES"; fi 60 | if [ -n "$INPUT_RELEASEURL" ]; then ARG_RELEASEURL="--release-url $INPUT_RELEASEURL"; fi 61 | if [ -n "$INPUT_GITHUBSITE" ]; then ARG_GITHUBSITE="--github-site $INPUT_GITHUBSITE"; fi 62 | if [ -n "$INPUT_GITHUBAPI" ]; then ARG_GITHUBAPI="--github-api $INPUT_GITHUBAPI"; fi 63 | if [[ -n $INPUT_SIMPLELIST ]]; then if istrue "$INPUT_SIMPLELIST"; then ARG_SIMPLELIST="--simple-list"; fi; fi 64 | if [ -n "$INPUT_FUTURERELEASE" ]; then ARG_FUTURERELEASE="--future-release $INPUT_FUTURERELEASE"; fi 65 | if [ -n "$INPUT_RELEASEBRANCH" ]; then ARG_RELEASEBRANCH="--release-branch $INPUT_RELEASEBRANCH"; fi 66 | if [[ -n $INPUT_HTTPCACHE ]]; then if istrue "$INPUT_HTTPCACHE"; then ARG_HTTPCACHE="--http-cache"; fi; fi 67 | if [ -n "$INPUT_CACHEFILE" ]; then ARG_CACHEFILE="--cache-file $INPUT_CACHEFILE"; fi 68 | if [ -n "$INPUT_CACHELOG" ]; then ARG_CACHELOG="--cache-log $INPUT_CACHELOG"; fi 69 | if [ -n "$INPUT_SSLCAFILE" ]; then ARG_SSLCAFILE="--ssl-ca-file $INPUT_SSLCAFILE"; fi 70 | if [[ -n $INPUT_VERBOSE ]]; then if istrue "$INPUT_VERBOSE"; then ARG_VERBOSE="--verbose"; else ARG_VERBOSE="--no-verbose"; fi; fi 71 | if [ -n "$INPUT_BREAKINGLABEL" ]; then ARG_BREAKINGLABEL=(--breaking-label "$INPUT_BREAKINGLABEL"); fi 72 | if [ -n "$INPUT_BREAKINGLABELS" ]; then ARG_BREAKINGLABELS=(--breaking-labels "$INPUT_BREAKINGLABELS"); fi 73 | if [ -n "$INPUT_ENHANCEMENTLABEL" ]; then ARG_ENHANCEMENTLABEL=(--enhancement-label "$INPUT_ENHANCEMENTLABEL"); fi 74 | if [ -n "$INPUT_ENHANCEMENTLABELS" ]; then ARG_ENHANCEMENTLABELS=(--enhancement-labels "$INPUT_ENHANCEMENTLABELS"); fi 75 | if [ -n "$INPUT_BUGSLABEL" ]; then ARG_BUGSLABEL=(--bugs-label "$INPUT_BUGSLABEL"); fi 76 | if [ -n "$INPUT_BUGLABELS" ]; then ARG_BUGLABELS=(--bug-labels "$INPUT_BUGLABELS"); fi 77 | if [ -n "$INPUT_DEPRECATEDLABEL" ]; then ARG_DEPRECATEDLABEL=(--deprecated-label "$INPUT_DEPRECATEDLABEL"); fi 78 | if [ -n "$INPUT_DEPRECATEDLABELS" ]; then ARG_DEPRECATEDLABELS=(--deprecated-labels "$INPUT_DEPRECATEDLABELS"); fi 79 | if [ -n "$INPUT_REMOVEDLABEL" ]; then ARG_REMOVEDLABEL=(--removed-label "$INPUT_REMOVEDLABEL"); fi 80 | if [ -n "$INPUT_REMOVEDLABELS" ]; then ARG_REMOVEDLABELS=(--removed-labels "$INPUT_REMOVEDLABELS"); fi 81 | if [ -n "$INPUT_SECURITYLABEL" ]; then ARG_SECURITYLABEL=(--security-label "$INPUT_SECURITYLABEL"); fi 82 | if [ -n "$INPUT_SECURITYLABELS" ]; then ARG_SECURITYLABELS=(--security-labels "$INPUT_SECURITYLABELS"); fi 83 | if [ -n "$INPUT_ISSUESLABEL" ]; then ARG_ISSUESLABEL=(--issues-label "$INPUT_ISSUESLABEL"); fi 84 | if [ -n "$INPUT_PRLABEL" ]; then ARG_PRLABEL=(--pr-label "$INPUT_PRLABEL"); fi 85 | 86 | # Generate change log. 87 | # shellcheck disable=SC2086 # We specifically want to allow word splitting. 88 | github_changelog_generator \ 89 | $ARG_USER \ 90 | $ARG_PROJECT \ 91 | $ARG_TOKEN \ 92 | $ARG_DATEFORMAT \ 93 | $ARG_OUTPUT \ 94 | $ARG_BASE \ 95 | "${ARG_HEADERLABEL[@]}" \ 96 | "${ARG_CONFIGURESECTIONS[@]}" \ 97 | "${ARG_ADDSECTIONS[@]}" \ 98 | "${ARG_FRONTMATTER[@]}" \ 99 | $ARG_ISSUES \ 100 | $ARG_ISSUESWOLABELS \ 101 | $ARG_PULLREQUESTS \ 102 | $ARG_PRWOLABELS \ 103 | $ARG_FILTERBYMILESTONE \ 104 | $ARG_AUTHOR \ 105 | $ARG_USERNAMESASGITHUBLOGINS \ 106 | $ARG_UNRELEASEDONLY \ 107 | $ARG_UNRELEASED \ 108 | "${ARG_UNRELEASEDLABEL[@]}" \ 109 | $ARG_COMPARELINK \ 110 | "${ARG_INCLUDELABELS[@]}" \ 111 | "${ARG_EXCLUDELABELS[@]}" \ 112 | "${ARG_ISSUELINELABELS[@]}" \ 113 | "${ARG_EXCLUDETAGS[@]}" \ 114 | "${ARG_EXCLUDETAGSREGEX[@]}" \ 115 | $ARG_SINCETAG \ 116 | $ARG_DUETAG \ 117 | $ARG_MAXISSUES \ 118 | $ARG_RELEASEURL \ 119 | $ARG_GITHUBSITE \ 120 | $ARG_GITHUBAPI \ 121 | $ARG_SIMPLELIST \ 122 | $ARG_FUTURERELEASE \ 123 | $ARG_RELEASEBRANCH \ 124 | $ARG_HTTPCACHE \ 125 | $ARG_CACHEFILE \ 126 | $ARG_CACHELOG \ 127 | $ARG_SSLCAFILE \ 128 | $ARG_VERBOSE \ 129 | "${ARG_BREAKINGLABEL[@]}" \ 130 | "${ARG_BREAKINGLABELS[@]}" \ 131 | "${ARG_ENHANCEMENTLABEL[@]}" \ 132 | "${ARG_ENHANCEMENTLABELS[@]}" \ 133 | "${ARG_BUGSLABEL[@]}" \ 134 | "${ARG_BUGLABELS[@]}" \ 135 | "${ARG_DEPRECATEDLABEL[@]}" \ 136 | "${ARG_DEPRECATEDLABELS[@]}" \ 137 | "${ARG_REMOVEDLABEL[@]}" \ 138 | "${ARG_REMOVEDLABELS[@]}" \ 139 | "${ARG_SECURITYLABEL[@]}" \ 140 | "${ARG_SECURITYLABELS[@]}" \ 141 | "${ARG_ISSUESLABEL[@]}" \ 142 | "${ARG_PRLABEL[@]}" 143 | 144 | # Locate change log. 145 | FILE="CHANGELOG.md" 146 | if [ -n "$INPUT_OUTPUT" ]; then FILE="$INPUT_OUTPUT"; fi 147 | 148 | # Strip Markdown headers. 149 | if istrue "$INPUT_STRIPHEADERS"; then 150 | echo "Stripping headers." 151 | sed -i '/^#/d' "$FILE" 152 | fi 153 | 154 | # Strip generator notice. 155 | if istrue "$INPUT_STRIPGENERATORNOTICE"; then 156 | echo "Stripping generator notice." 157 | sed -i '/This Changelog was automatically generated/d' "$FILE" 158 | fi 159 | 160 | # Save change log to outputs. 161 | if [[ -e "$FILE" ]]; then 162 | CONTENT=$(cat "$FILE") 163 | # Escape as per https://github.community/t/set-output-truncates-multiline-strings/16852/3. 164 | CONTENT="${CONTENT//'%'/'%25'}" 165 | CONTENT="${CONTENT//$'\n'/'%0A'}" 166 | CONTENT="${CONTENT//$'\r'/'%0D'}" 167 | echo "changelog=$CONTENT" >> $GITHUB_OUTPUT 168 | fi 169 | --------------------------------------------------------------------------------