-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41b5326
commit 2254c87
Showing
2 changed files
with
112 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,3 +81,115 @@ jobs: | |
tag: ${{ needs.update-tag.outputs.tag }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
update-changelog: | ||
runs-on: ubuntu-latest | ||
needs: [ release ] | ||
name: changelog generator | ||
timeout-minutes: 5 | ||
if: ${{ !contains(github.event.head_commit.message, 'skip') && needs.update-tag.outputs.draft && github.ref == 'refs/heads/main' }} | ||
steps: | ||
# To use this repository's private action, you must check out the repository | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 30 | ||
submodules: 'true' | ||
|
||
# https://github.com/marketplace/actions/tag-changelog | ||
- name: create changelog text | ||
uses: loopwerk/conventional-changelog-action@latest | ||
id: ch | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
config_file: .github/tag-changelog-config.js | ||
|
||
- name: read 'templates/changelog.history' | ||
id: ch-history | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: .github/templates/changelog.history | ||
|
||
- name: read 'templates/changelog' | ||
id: ch-template | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: .github/templates/changelog | ||
|
||
- name: write to changelog.md | ||
uses: DamianReeves/write-file-action@master | ||
with: | ||
path: CHANGELOG.md | ||
contents: | | ||
${{ steps.ch-template.outputs.content }}${{ steps.ch.outputs.changelog }}${{ steps.ch-history.outputs.content }} | ||
write-mode: overwrite | ||
|
||
- name: write to 'templates/changelog.history' | ||
uses: DamianReeves/write-file-action@master | ||
with: | ||
path: .github/templates/changelog.history | ||
contents: | | ||
${{ steps.ch.outputs.changelog }}${{ steps.ch-history.outputs.content }} | ||
write-mode: overwrite | ||
|
||
- name: check local changes | ||
id: diff | ||
run: | | ||
changed_files=$(git status --porcelain --untracked-files=all | wc -l) | ||
echo ::set-output name=count::$changed_files | ||
echo ::set-output name=created::$(date) | ||
shell: bash | ||
|
||
- name: Bump version and push tag | ||
uses: anothrNick/[email protected] | ||
id: tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DRY_RUN: true | ||
|
||
- | ||
name: create pull request | ||
uses: peter-evans/create-pull-request@v3 | ||
id: cpr | ||
if: ${{ steps.ch.outputs.changes }} | ||
with: | ||
branch: docs/changelog | ||
base: ${{ github.head_ref }} | ||
delete-branch: true | ||
labels: | | ||
kind/docs | ||
:memo: documentation | ||
:memo: docs | ||
:bell: approved | ||
:bell: automerge | ||
:robot: bot | ||
committer: ${{ env.COMMITTER_BOT }} | ||
author: ${{ env.AUTHOR_BOT }} | ||
title: | | ||
"docs: update changelog "${{ steps.tag.outputs.tag }} #${{ github.run_number }}" ' | ||
commit-message: | | ||
'docs: Update CHANGELOG.md "${{ github.workflow }} #${{ github.run_number }}" [skip ci]' | ||
body: | | ||
## Description | ||
Update CHANGELOG.md | ||
${{ steps.changelog.outputs.changelog }} | ||
## Update report workflow | ||
- Updated with *today's* date **`${{ steps.diff.outputs.created }}`** | ||
- Current Tag: **`${{ steps.tag.outputs.tag }}`** | ||
- Name: **${{ github.workflow }}** | ||
- Run ID: **${{ github.run_id }}** | ||
- Run Number: **${{ github.run_number }}** | ||
_Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
- name: check outputs | ||
if: ${{ steps.changelog.outputs.changes }} | ||
run: | | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |