fix: fixing the yaml code #6
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
name: Release | |
# don't mind this comment message | |
on: | |
push: | |
branches: | |
- main # Adjust this to your main branch name or the branch you want to trigger the workflow on | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Extract commit messages | |
id: commits | |
run: | | |
echo "::set-output name=messages::$(git log --pretty=format:'%s' --no-merges ${{ github.event.before }}..${{ github.sha }})" | |
- name: Determine next version | |
id: next_version | |
run: | | |
version=$(echo "${{ steps.commits.outputs.messages }}" | grep -E '^(feat|fix|chore|docs|style|refactor|test|perf|build|ci):' | cut -d':' -f1 | sort -u) | |
echo "::set-output name=version::$version" | |
- name: Generate release notes | |
id: release_notes | |
run: | | |
echo "::set-output name=notes::Your release notes based on commit messages" | |
- name: Create release | |
uses: actions/create-release@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.next_version.outputs.version }} | |
release_name: Release ${{ steps.next_version.outputs.version }} | |
body: ${{ steps.release_notes.outputs.notes }} | |
draft: false | |
prerelease: false |