mirror of
https://github.com/DuendeSoftware/products
synced 2026-05-24 09:28:24 +00:00
Improve version validation messages
This commit is contained in:
parent
6b861fada6
commit
39e58fb679
6 changed files with 11 additions and 11 deletions
2
.github/workflow-gen/Program.cs
vendored
2
.github/workflow-gen/Program.cs
vendored
|
|
@ -237,7 +237,7 @@ void GenerateReleaseWorkflow(Product product)
|
|||
|
||||
job.Step()
|
||||
.Name("Validate Version Input")
|
||||
.Run($@"echo '{contexts.Event.Input.Version}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$'");
|
||||
.Run($@"echo '{contexts.Event.Input.Version}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$' || (echo 'Invalid version format' && exit 1)");
|
||||
|
||||
job.StepGitCheckoutCustomBranch();
|
||||
job.StepGitConfig();
|
||||
|
|
|
|||
6
.github/workflow-gen/StepExtensions.cs
vendored
6
.github/workflow-gen/StepExtensions.cs
vendored
|
|
@ -182,7 +182,7 @@ public static class StepExtensions
|
|||
|
||||
public static WorkflowDispatch InputVersionBranchAndTagOverride(this WorkflowDispatch workflow) =>
|
||||
workflow.Inputs(
|
||||
new StringInput("version", "Version in format X.Y.Z or X.Y.Z-preview.", true, "0.0.0"),
|
||||
new StringInput("version", "Version in format X.Y.Z, X.Y.Z-preview.N, or X.Y.Z-rc.N", true, "0.0.0"),
|
||||
new StringInput("branch", "(Optional) the name of the branch to release from", false, "main"),
|
||||
new BooleanInput("remove-tag-if-exists", "If set, will remove the existing tag. Use this if you have issues with the previous release action", false, false));
|
||||
|
||||
|
|
@ -225,14 +225,14 @@ public static class StepExtensions
|
|||
/// Only (trusted) contributors can open branches in the main repo, so these builds can run with a higher trust level.
|
||||
/// So, they are running with trigger 'push'. These builds have access to the secrets and thus they can do things like
|
||||
/// sign, push the packages, etc..
|
||||
///
|
||||
///
|
||||
/// External contributors can only create branches on external repo's. These builds run with a lower trust level.
|
||||
/// So, they are running with trigger 'pull_request'. These builds do not have access to the secrets and thus they can't
|
||||
/// sign, push the packages, etc..
|
||||
///
|
||||
/// Now, if a trusted contributor creates a branch in the main repo, then creates a PR, we don't want to run the build twice.
|
||||
/// This prevents that. The build will only run once, on the branch with the higher trust level.
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public static Job RunEitherOnBranchOrAsPR(this Job job)
|
||||
=> job.If(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
|
||||
description: 'Version in format X.Y.Z, X.Y.Z-preview.N, or X.Y.Z-rc.N'
|
||||
type: string
|
||||
required: true
|
||||
default: '0.0.0'
|
||||
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Validate Version Input
|
||||
run: echo '${{ github.event.inputs.version }}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$'
|
||||
run: echo '${{ github.event.inputs.version }}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$' || (echo 'Invalid version format' && exit 1)
|
||||
- name: Checkout target branch
|
||||
if: github.event.inputs.branch != 'main'
|
||||
run: git checkout ${{ github.event.inputs.branch }}
|
||||
|
|
|
|||
4
.github/workflows/bff-release.yml
vendored
4
.github/workflows/bff-release.yml
vendored
|
|
@ -5,7 +5,7 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
|
||||
description: 'Version in format X.Y.Z, X.Y.Z-preview.N, or X.Y.Z-rc.N'
|
||||
type: string
|
||||
required: true
|
||||
default: '0.0.0'
|
||||
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Validate Version Input
|
||||
run: echo '${{ github.event.inputs.version }}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$'
|
||||
run: echo '${{ github.event.inputs.version }}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$' || (echo 'Invalid version format' && exit 1)
|
||||
- name: Checkout target branch
|
||||
if: github.event.inputs.branch != 'main'
|
||||
run: git checkout ${{ github.event.inputs.branch }}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
|
||||
description: 'Version in format X.Y.Z, X.Y.Z-preview.N, or X.Y.Z-rc.N'
|
||||
type: string
|
||||
required: true
|
||||
default: '0.0.0'
|
||||
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Validate Version Input
|
||||
run: echo '${{ github.event.inputs.version }}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$'
|
||||
run: echo '${{ github.event.inputs.version }}' | grep -P '^\d+\.\d+\.\d+(-preview\.\d+|-rc\.\d+)?$' || (echo 'Invalid version format' && exit 1)
|
||||
- name: Checkout target branch
|
||||
if: github.event.inputs.branch != 'main'
|
||||
run: git checkout ${{ github.event.inputs.branch }}
|
||||
|
|
|
|||
2
.github/workflows/templates-release.yml
vendored
2
.github/workflows/templates-release.yml
vendored
|
|
@ -5,7 +5,7 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
|
||||
description: 'Version in format X.Y.Z, X.Y.Z-preview.N, or X.Y.Z-rc.N'
|
||||
type: string
|
||||
required: true
|
||||
default: '0.0.0'
|
||||
|
|
|
|||
Loading…
Reference in a new issue