- introduce capability to define the Configuration via the build yml without the requirement of a file

- this also allows to generate changelogs without the need to chech-out
This commit is contained in:
Mike Penz
2022-07-29 09:21:44 +00:00
committed by GitHub
parent ffcbb8e311
commit 02b79cb00a
7 changed files with 130 additions and 28 deletions
+42 -2
View File
@@ -103,6 +103,9 @@ Below is a complete example showcasing how to define a build, which is executed
> Note: PRs will only show up in the changelog if assigned one of the default label categories "feature", "fix" or "test"
<details><summary><b>Example</b></summary>
<p>
```yml
name: 'CI'
on:
@@ -122,11 +125,47 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v0.1.14
uses: mikepenz/action-gh-release@v0.2.0-a02 #softprops/action-gh-release
with:
body: ${{steps.github_release.outputs.changelog}}
```
</p>
</details>
<details><summary><b>Example w/ Configuration</b></summary>
<p>
```yml
jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Build Changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
configurationJson: |
{
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
"categories": [
{
"title": "## 💬 Other",
"labels": ["other"]
},
{
"title": "## 📦 Dependencies",
"labels": ["dependencies"]
}
],
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
</p>
</details>
## Customization 🖍️
### Note
@@ -152,7 +191,7 @@ The action supports flexible configuration options to modify vast areas of its b
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
> **Warning** It is required to have a `checkout` step prior to the changelog step, to allow the action to discover the configuration file.
> **Warning** It is required to have a `checkout` step prior to the changelog step if `configuration` is used, to allow the action to discover the configuration file. Use `configurationJson` as alternative.
This configuration is a `.json` file in the following format.
@@ -262,6 +301,7 @@ For advanced use cases additional settings can be provided to the action
| **Input** | **Description** |
|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `configurationJson` | Provide the configuration directly via the build `yml` file. |
| `configuration` | Relative path, to the `configuration.json` file, providing additional configurations |
| `outputFile` | Optional relative path to a file to store the resulting changelog in. |
| `owner` | The owner of the repository to generate the changelog for |