Release Notes Draft generator #165
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: Release Notes Draft generator | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| type: string | |
| required: true | |
| default: "9.0" | |
| last_release: | |
| type: string | |
| required: true | |
| default: "9.0.0" | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| main: | |
| runs-on: ubuntu-latest | |
| env: | |
| BRANCH: ${{ github.event.inputs.branch }} | |
| LAST_RELEASE: ${{ github.event.inputs.last_release }} | |
| ACTOR: ${{ github.actor }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Validate the supplied target branch and last release tag exist | |
| run: | | |
| if ! git rev-parse --verify "origin/${BRANCH}" >/dev/null 2>&1; then | |
| echo "Error: Branch ${BRANCH} does not exist" | |
| exit 1 | |
| fi | |
| if ! git rev-parse --verify "v${LAST_RELEASE}" >/dev/null 2>&1; then | |
| echo "Error: Tag v${LAST_RELEASE} does not exist" | |
| exit 1 | |
| fi | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.0' | |
| - run: git config --global user.email "[email protected]" | |
| - run: git config --global user.name "logstashmachine" | |
| - name: Create Release Notes Draft | |
| run: | | |
| if [[ "${BRANCH}" =~ ^([0-8])\.[0-9]+$ ]]; then | |
| echo "Using Asciidoc generator" | |
| SCRIPT="./tools/release/generate_release_notes.rb" | |
| else | |
| echo "Using Markdown generator" | |
| SCRIPT="./tools/release/generate_release_notes_md.rb" | |
| fi | |
| $SCRIPT "${BRANCH}" "${LAST_RELEASE}" "${ACTOR}" "${{ secrets.GITHUB_TOKEN }}" |