Skip to content

Commit

Permalink
fix:Make the auto releaser tag by default instead of release directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtw committed Jun 21, 2024
1 parent dc0600d commit e3cd80d
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/auto-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,25 @@ name: 'Auto Releaser'
on:
workflow_call:
inputs:

branch:
description: 'Branch to release from.'
type: string
required: false
default: 'main'

patch-list:
description: 'Comma separated list of commit types that should trigger a patch release.'
type: string
required: false
default: 'fix, bugfix, perf, refactor, test, tests, chore'

which:
description: Create a 'release' or 'tag'.
type: string
required: false
default: tag

jobs:
release:
permissions: write-all
Expand All @@ -57,10 +65,34 @@ jobs:

- name: Create Release
if: |
steps.semver.outputs.next != ''
steps.semver.outputs.next != '' &&
inputs.which == 'tag'
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
name: ${{ steps.semver.outputs.next }}
tag: ${{ steps.semver.outputs.next }}
commit: ${{ github.sha }}
token: ${{ github.token }}

- name: Create Tag
if: |
steps.semver.outputs.next != '' &&
inputs.which == 'tag'
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.semver.outputs.next }}',
sha: context.sha
}
- name: Failure
if: |
steps.semver.outputs.next != '' &&
inputs.which != 'release' &&
inputs.which != 'tag'
run: |
echo "No new version found."
exit

0 comments on commit e3cd80d

Please sign in to comment.