|
1 | | -changelog: |
2 | | - sections: |
3 | | - - title: ":rocket: Enhancements & Features" |
4 | | - labels: [ "Type: enhancement", "Type: documentation", "Type: example" ] |
5 | | - - title: ":bug: Bug Fixes" |
6 | | - labels: [ "Type: bug" ] |
7 | | - - title: ":hammer_and_wrench: Chore" |
8 | | - labels: [ "Type: dependencies", "Type: build", "Type: codacy" ] |
9 | | - issues: |
10 | | - exclude: |
11 | | - labels: [ "Type: question" ] |
12 | | - contributors: |
13 | | - exclude: |
14 | | - names: [ "dependabot[bot]" ] |
| 1 | +# Trigger the workflow on milestone events |
| 2 | +on: |
| 3 | + milestone: |
| 4 | + types: [closed] |
| 5 | +name: Milestone Closure |
| 6 | +jobs: |
| 7 | + create-release-notes: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - name: Checkout code |
| 11 | + uses: actions/checkout@master |
| 12 | + - name: Create Release Notes Markdown |
| 13 | + uses: docker://decathlon/release-notes-generator-action:3.1.5 |
| 14 | + env: |
| 15 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 16 | + OUTPUT_FOLDER: temp_release_notes |
| 17 | + USE_MILESTONE_TITLE: "true" |
| 18 | + - name: Get the name of the created Release Notes file and extract Version |
| 19 | + run: | |
| 20 | + RELEASE_NOTES_FILE=$(ls temp_release_notes/*.md | head -n 1) |
| 21 | + echo "RELEASE_NOTES_FILE=$RELEASE_NOTES_FILE" >> $GITHUB_ENV |
| 22 | + VERSION=$(echo ${{ github.event.milestone.title }} | cut -d' ' -f2) |
| 23 | + echo "VERSION=$VERSION" >> $GITHUB_ENV |
| 24 | + - name: Create a Draft Release Notes on GitHub |
| 25 | + id: create_release |
| 26 | + uses: actions/create-release@v1 |
| 27 | + env: |
| 28 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 29 | + with: |
| 30 | + tag_name: ${{ env.VERSION }} |
| 31 | + release_name: ${{ env.VERSION }} |
| 32 | + body_path: ${{ env.RELEASE_NOTES_FILE }} |
| 33 | + draft: true |
0 commit comments