Release #6
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 Approval | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g., v0.1.0)' | |
| required: true | |
| release_title: | |
| description: 'Release title' | |
| required: false | |
| release_notes: | |
| description: 'Release notes (optional)' | |
| required: false | |
| jobs: | |
| approve-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Wait for manual approval | |
| uses: trstringer/manual-approval@v1 | |
| with: | |
| secret: ${{ github.TOKEN }} | |
| approvers: sgerlach,kcberg,danielhopkins,clamey,Bwvolleyball | |
| minimum-approvals: 1 | |
| fail-on-denial: true | |
| - name: Check CI status for this commit | |
| id: check_ci | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const commit = context.sha; | |
| const { data: runs } = await github.rest.actions.listWorkflowRunsForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| branch: 'main', | |
| event: 'push', | |
| status: 'completed', | |
| per_page: 10 | |
| }); | |
| const ciRun = runs.workflow_runs.find(run => run.name === 'CI' && run.head_sha === commit); | |
| if (!ciRun) { | |
| core.setFailed('No CI workflow run found for this commit.'); | |
| } else if (ciRun.conclusion !== 'success') { | |
| core.setFailed(`CI workflow did not succeed (status: ${ciRun.conclusion}). Release aborted.`); | |
| } | |
| - name: Create GitHub Release | |
| if: steps.check_ci.outcome == 'success' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag }} | |
| name: ${{ github.event.inputs.release_title || github.event.inputs.tag }} | |
| body: ${{ github.event.inputs.release_notes }} | |
| draft: false | |
| prerelease: false | |
| permissions: | |
| actions: read | |
| issues: write | |
| contents: write |