github: typo fix (#3070)

* github: typo fix
* github: sdk action: added validation for action inputs
* github: sdk action: 10+ rcs
This commit is contained in:
hedger 2023-09-12 12:24:44 +03:00 committed by GitHub
parent 8bfa9898e3
commit f0f2a6c11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 4 deletions

View File

@ -5,10 +5,10 @@ description: |
inputs: inputs:
catalog-url: catalog-url:
description: The URL of the Catalog API description: The URL of the Catalog API. Must not be empty or end with a /.
required: true required: true
catalog-api-token: catalog-api-token:
description: The token to use to authenticate with the Catalog API description: The token to use to authenticate with the Catalog API. Must not be empty.
required: true required: true
firmware-api: firmware-api:
description: Fimware's API version, major.minor description: Fimware's API version, major.minor
@ -17,12 +17,35 @@ inputs:
description: Firmware's target, e.g. f7/f18 description: Firmware's target, e.g. f7/f18
required: true required: true
firmware-version: firmware-version:
description: Firmware's version, e.g. 0.13.37-rc3 description: Firmware's version, e.g. 0.13.37-rc3, or 0.13.37
required: true required: true
runs: runs:
using: composite using: composite
steps: steps:
- name: Check inputs
shell: bash
run: |
if [ -z "${{ inputs.catalog-url }}" ] ; then
echo "Invalid catalog-url: ${{ inputs.catalog-url }}"
exit 1
fi
if [ -z "${{ inputs.catalog-api-token }}" ] ; then
echo "Invalid catalog-api-token: ${{ inputs.catalog-api-token }}"
exit 1
fi
if ! echo "${{ inputs.firmware-api }}" | grep -q "^[0-9]\+\.[0-9]\+$" ; then
echo "Invalid firmware-api: ${{ inputs.firmware-api }}"
exit 1
fi
if ! echo "${{ inputs.firmware-target }}" | grep -q "^f[0-9]\+$" ; then
echo "Invalid firmware-target: ${{ inputs.firmware-target }}"
exit 1
fi
if ! echo "${{ inputs.firmware-version }}" | grep -q "^[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\)\?\([0-9]\+\)\?$" ; then
echo "Invalid firmware-version: ${{ inputs.firmware-version }}"
exit 1
fi
- name: Submit SDK - name: Submit SDK
shell: bash shell: bash
run: | run: |

View File

@ -165,5 +165,5 @@ jobs:
catalog-url: ${{ secrets.CATALOG_URL }} catalog-url: ${{ secrets.CATALOG_URL }}
catalog-api-token: ${{ secrets.CATALOG_API_TOKEN }} catalog-api-token: ${{ secrets.CATALOG_API_TOKEN }}
firmware-api: ${{ steps.build-fw.outputs.firmware_api }} firmware-api: ${{ steps.build-fw.outputs.firmware_api }}
firwmare-target: ${{ matrix.target }} firmware-target: ${{ matrix.target }}
firmware-version: ${{ steps.names.outputs.suffix }} firmware-version: ${{ steps.names.outputs.suffix }}