Skip to content

Commit de98428

Browse files
authored
ci(auto-release): Allow pre-releases in auto release (#11769)
addition to #11655 Only the first regex group was used for the version variable which didn't allow pre-releases in the changelog.
1 parent 92bc6c6 commit de98428

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/auto-release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,27 @@ jobs:
2020

2121
# https://github.com/actions-ecosystem/action-regex-match
2222
- uses: actions-ecosystem/action-regex-match@v2
23-
id: version
23+
id: version-regex
2424
with:
2525
# Parse version from head branch
2626
text: ${{ github.head_ref }}
2727
# match: preprare-release/xx.xx.xx
2828
regex: '^prepare-release\/(\d+\.\d+\.\d+)(?:-(alpha|beta)\.\d+)?$'
2929

30+
- name: Extract version
31+
id: get_version
32+
run: |
33+
version=${{ steps.version-regex.outputs.match }}
34+
version=${version/'prepare-release/'/''}
35+
echo "version=$version" >> $GITHUB_OUTPUT
36+
3037
- name: Prepare release
3138
uses: getsentry/action-prepare-release@v1
32-
if: github.event.pull_request.merged == true && steps.version.outputs.match != ''
39+
if: github.event.pull_request.merged == true && steps.version-regex.outputs.match != '' && steps.get_version.outputs.version != ''
3340
env:
3441
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
3542
with:
36-
version: ${{ steps.version.outputs.group1 }}
43+
version: ${{ steps.get_version.outputs.version }}
3744
force: false
3845
merge_target: master
3946
craft_config_from_merge_target: true

0 commit comments

Comments
 (0)