-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improved when Tag is created. (#83)
- Fixed camelCase for input parameter.
- Loading branch information
1 parent
377334a
commit fc41801
Showing
1 changed file
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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 |