generated from wayfair-incubator/oss-template
-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (35 loc) · 1.39 KB
/
detect_version_bump.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Version Bump merged
on:
pull_request:
types:
- "closed"
branches:
- "main"
jobs:
trigger-release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged &&
startsWith(github.head_ref, 'bump_version_to_') &&
startsWith(github.event.pull_request.title, 'Bump version') &&
contains(github.event.pull_request.title, ' → ')
environment: Create Release
steps:
- name: Get new version
id: get-new-version
run: |
NEW_VERSION=$(echo ${{ github.head_ref }} | cut -d _ -f4 )
echo "::set-output name=version::$NEW_VERSION"
- name: Is prerelease?
id: is-prerelease
run: |
IS_PRERELEASE=$([[ "${{ steps.get-new-version.outputs.version }}" == *-[a-z]* ]] && echo true || echo false)
echo "::set-output name=result::$IS_PRERELEASE"
# - name: Create Release
# # Using full SHA for security
# # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
# uses: ncipollo/release-action@4c75f0f2e4ae5f3c807cf0904605408e319dcaac # renovate: tag=v1.11.1
# with:
# tag: v${{ steps.get-new-version.outputs.version }}
# name: v${{ steps.get-new-version.outputs.version }} Release
# commit: main
# prerelease: ${{ steps.is-prerelease.outputs.result }}