diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index 9f9316e2..f99699d0 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -18,7 +18,7 @@ name: Release - create draft release on: workflow_dispatch: inputs: - tagName: + tag-name: description: 'Name of git tag to be created, and then draft release created. Syntax: "v[0-9]+.[0-9]+.[0-9]+".' required: true @@ -41,7 +41,7 @@ jobs: core.setFailed('Tag does not match the required format "v[0-9]+.[0-9]+.[0-9]+"'); return; } - tag-name: ${{ github.event.inputs.tagName }} + tag-name: ${{ github.event.inputs.tag-name }} - name: Check tag's correct version increment uses: actions/github-script@v7 @@ -73,26 +73,7 @@ jobs: return; } - tag-name: ${{ github.event.inputs.tagName }} - - - name: Create and push tag - uses: actions/github-script@v7 - with: - script: | - const tag = core.getInput('tag-name') - const ref = `refs/tags/${tag}`; - const sha = context.sha; // The SHA of the commit to tag - - await github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: ref, - sha: sha - }); - - console.log(`Tag created: ${tag}`); - github-token: ${{ secrets.GITHUB_TOKEN }} - tag-name: ${{ github.event.inputs.tagName }} + tag-name: ${{ github.event.inputs.tag-name }} release: needs: tag @@ -101,7 +82,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: refs/tags/${{ github.event.inputs.tagName }} + ref: refs/tags/${{ github.event.inputs.tag-name }} - uses: actions/setup-python@v5.1.1 with: @@ -113,7 +94,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag-name: ${{ github.event.inputs.tagName }} + tag-name: ${{ github.event.inputs.tag-name }} chapters: | [ {"title": "Breaking Changes 💥", "label": "breaking-change"}, @@ -123,13 +104,32 @@ jobs: ] warnings: true + - name: Create and Push Tag + uses: actions/github-script@v7 + with: + script: | + const tag = core.getInput('tag-name') + const ref = `refs/tags/${tag}`; + const sha = context.sha; // The SHA of the commit to tag + + await github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: ref, + sha: sha + }); + + console.log(`Tag created: ${tag}`); + github-token: ${{ secrets.GITHUB_TOKEN }} + tag-name: ${{ github.event.inputs.tag-name }} + - name: Create draft release uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: ${{ github.event.inputs.tagName }} - body: ${{ steps.release_notes_generator.outputs.releaseNotes }} - tag_name: ${{ github.event.inputs.tagName }} + name: ${{ github.event.inputs.tag-name }} + body: ${{ steps.release_notes_generator.outputs.release-notes }} + tag_name: ${{ github.event.inputs.tag-name }} draft: true prerelease: false