mirror of
https://github.com/orhun/git-cliff-action.git
synced 2026-03-22 07:25:43 +08:00
docs(readme): add example about writing the changelog (#13)
This commit is contained in:
35
README.md
35
README.md
@@ -101,6 +101,41 @@ jobs:
|
||||
body: ${{ needs.changelog.outputs.release_body }}
|
||||
```
|
||||
|
||||
#### Committing the changelog
|
||||
|
||||
You can use this action as follows if you want to generate a changelog and commit it to the repository:
|
||||
|
||||
```yml
|
||||
jobs:
|
||||
changelog:
|
||||
name: Generate changelog
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate a changelog
|
||||
uses: orhun/git-cliff-action@v2
|
||||
with:
|
||||
config: cliff.toml
|
||||
args: --verbose
|
||||
env:
|
||||
OUTPUT: CHANGELOG.md
|
||||
|
||||
- name: Commit
|
||||
run: |
|
||||
git config user.name 'github-actions[bot]'
|
||||
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
set +e
|
||||
git add CHANGELOG.md
|
||||
git commit -m "Update changelog"
|
||||
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git <branch>
|
||||
```
|
||||
|
||||
Please note that you need to change the `<branch>` to the branch name that you want to push.
|
||||
|
||||
## Credits
|
||||
|
||||
This action is based on [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) and uses [git-cliff](https://github.com/orhun/git-cliff).
|
||||
|
||||
Reference in New Issue
Block a user