mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
update bump-version.yml (#31542)
* update bump-version.yml * Update bump-version.yml
This commit is contained in:
parent
f51653647d
commit
a7e243db8a
38
.github/workflows/bump-version.yml
vendored
38
.github/workflows/bump-version.yml
vendored
@ -9,6 +9,44 @@ jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
- uses: actions-ecosystem/action-regex-match@v2
|
||||
id: regex-match
|
||||
with:
|
||||
text: ${{ github.event.inputs.version }}
|
||||
regex: '^(\d+.\d+).\d+(?:-beta.\d+)?$'
|
||||
|
||||
- name: Validate input version
|
||||
if: ${{ steps.regex-match.outputs.match == '' }}
|
||||
run: |
|
||||
echo "The input version format is not correct, please respect:\
|
||||
major.minor.patch or major.minor.patch-beta.number format. \
|
||||
example: 7.4.3 or 7.4.3-beta.1"
|
||||
exit 1
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set intermedia variables
|
||||
id: intermedia
|
||||
run: |
|
||||
echo "::set-output name=short_ref::${GITHUB_REF#refs/*/}"
|
||||
echo "::set-output name=check_passed::false"
|
||||
echo "::set-output name=branch_name::v${{steps.regex-match.outputs.group1}}"
|
||||
echo "::set-output name=branch_exist::$(git ls-remote --heads https://github.com/grafana/grafana.git v${{ steps.regex-match.outputs.group1 }}.x | wc -l)"
|
||||
|
||||
- name: Check input version is aligned with branch(not master)
|
||||
if: steps.intermedia.outputs.branch_exist != '0' && !contains(steps.intermedia.outputs.short_ref, steps.intermedia.outputs.branch_name)
|
||||
run: |
|
||||
echo " You need to run the workflow on branch v${{steps.regex-match.outputs.group1}}.x
|
||||
exit 1
|
||||
|
||||
- name: Check input version is aligned with branch(master)
|
||||
if: steps.intermedia.outputs.branch_exist == '0' && !contains(steps.intermedia.outputs.short_ref, 'main')
|
||||
run: |
|
||||
echo "When you want to deliver a new new minor version, you might want to create a new branch first \
|
||||
with naming convention v[major].[minor].x, and just run the workflow on that branch. \
|
||||
Run the workflow on master only when needed"
|
||||
exit 1
|
||||
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
|
Loading…
Reference in New Issue
Block a user