doc: Update CHANGELOG.md #342
This file contains hidden or 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
| name: Update CHANGELOG.md | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| jobs: | |
| changelog: | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| token: ${{ secrets.GIT_BOT_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Generate a changelog | |
| uses: orhun/git-cliff-action@v4.4.2 | |
| with: | |
| config: cliff.toml | |
| args: --verbose | |
| env: | |
| OUTPUT: CHANGELOG.md | |
| - name: Import GPG key | |
| id: import_gpg | |
| uses: crazy-max/ghaction-import-gpg@v6.2.0 | |
| with: | |
| gpg_private_key: ${{ secrets.GIT_ACTIONS_GPG_KEY }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| - name: Commit and push changes | |
| run: | | |
| COMMIT_AUTHOR=$(git log -1 --pretty=%an) | |
| if [[ "$COMMIT_AUTHOR" != "HeCodes2Much-Bot" ]]; then | |
| if [[ `git status --porcelain` ]]; then | |
| git config --global user.name ${{ secrets.GIT_NAME }} | |
| git config --global user.email ${{ secrets.GIT_EMAIL }} | |
| git add -A | |
| git commit -m "doc: Update CHANGELOG.md" | |
| git push | |
| else | |
| echo "WARNING: No changes were detected." | |
| fi | |
| else | |
| echo "WARNING: $COMMIT_AUTHOR last commited." | |
| fi | |
| shell: bash |