Merge pull request #23 from SpokaneTech/dependency_update #26
Workflow file for this run
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: Create GitHub Release | |
| on: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get tag name | |
| id: tag | |
| run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Generate release notes | |
| id: release_notes | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const tag = process.env.GITHUB_REF_NAME; | |
| const { data: commits } = await github.rest.repos.listCommits({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| per_page: 20, | |
| }); | |
| const notes = commits.map(c => { | |
| const msg = c.commit.message.split('\n')[0]; | |
| const sha = c.sha.substring(0, 7); | |
| const author = c.commit.author.name; | |
| return `- ${msg} (${sha}, by ${author})`; | |
| }).join('\n'); | |
| return notes; | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| name: Release ${{ steps.tag.outputs.tag }} | |
| body: ${{ steps.release_notes.outputs.result }} |