Skip to content

Commit

Permalink
💚 Ci: validate inputes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mastersam07 committed Nov 8, 2024
1 parent 4d4a09b commit 5d71fd3
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/conferenceapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,47 @@ on:

changelog:
description: 'Changelog for this release'
required: true
required: false

build-version:
description: 'Version number for the release'
required: ${{ github.event.inputs.release-type == 'build' }}
required: false
default: ''
type: string

build-number:
required: ${{ github.event.inputs.release-type == 'build' }}
required: false
default: ''
type: string

env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}

jobs:

validate-inputs:
runs-on: ubuntu-latest
steps:
- name: Validate Inputs
run: |
if [[ "${{ github.event.inputs.release-type }}" == "build" ]]; then
if [[ -z "${{ github.event.inputs.build-version }}" ]]; then
echo "Error: build-version is required for a build release."
exit 1
fi
if [[ -z "${{ github.event.inputs.build-number }}" ]]; then
echo "Error: build-number is required for a build release."
exit 1
fi
if [[ -z "${{ github.event.inputs.changelog }}" ]]; then
echo "Error: changelog is required for a build release."
exit 1
fi
fi
if [[ "${{ github.event.inputs.release-type }}" == "patch" ]]; then
echo "Patch release selected. Skipping build-version and build-number validation."
fi
check-formatting:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/shared-workflow.yaml
Expand Down

0 comments on commit 5d71fd3

Please sign in to comment.