Skip to content

Mixed inputs

Mixed inputs #22

Workflow file for this run

name: Mixed inputs
on:
push:
branches:
- "main"
workflow_dispatch:
inputs:
name:
type: choice
description: Who to greet
options:
- monalisa
- cschleiden
- hujjj
required: true
use-emoji:
type: boolean
description: Include 🎉🤣 emojis
message:
description: message
type: string
jobs:
greet:
runs-on: ubuntu-latest
if: ${{ !! github.event.inputs.message }}
steps:
- name: Send greeting
run: echo "${{ github.event.inputs.message }} ${{ fromJSON('["", "🥳"]')[github.event.inputs.use-emoji == 'true'] }} ${{ github.event.inputs.name }}"
no-greet:
runs-on: ubuntu-latest
if: ${{ ! github.event.inputs.message }}
steps:
- name: Send greeting
run: echo "Supplymessage ${{ fromJSON('["", "🥳"]')[github.event.inputs.use-emoji == 'true'] }} ${{ github.event.inputs.name }}"
exit:
runs-on: ubuntu-latest
steps:
- name: Early exit
run: |
if [[ "${{ github.event.inputs.message }}" =~ exit ]];
then
echo "Early exit github.run_id ${{ github.run_id }}"
exit 1
else
echo "Run test"
fi
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
- run: npm ci
- run: npm test
- run: npm run lint