changelog print test #3
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: changelog print test | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| test-git-logs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get commit messages since last tag | |
| id: release_notes | |
| run: | | |
| git fetch --tags | |
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| if [ -z "$LAST_TAG" ]; then | |
| git log --pretty=format:"%s %h" > changelog.txt | |
| else | |
| git log ${LAST_TAG}..HEAD --pretty=format:"%s %h" > changelog.txt | |
| fi | |
| - name: print changelog | |
| run: cat changelog.txt | |