Skip to content

Commit

Permalink
er
Browse files Browse the repository at this point in the history
  • Loading branch information
Emis Simo committed Sep 29, 2023
1 parent b60d9a2 commit 4488ad6
Showing 1 changed file with 24 additions and 30 deletions.
54 changes: 24 additions & 30 deletions .github/workflows/variabletest.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
name: Dynamic Choice Options

on:
workflow_dispatch:
inputs:
choice:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
description: Select a tag
options:
- Loading...
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
environment:
description: 'Environment to run tests against'
type: environment
required: true

jobs:
build:
log-the-inputs:
runs-on: ubuntu-latest

steps:
- name: Check Out Repository
uses: actions/checkout@v2

- name: Get Git Tags
id: git_tags
run: |
git fetch --tags
tags=$(git tag -l)
echo "::set-output name=tags::$tags"
shell: bash

- name: Set Choice Input Options
if: steps.git_tags.outputs.tags != ''
id: set_choice_options
run: |
tags="${{ steps.git_tags.outputs.tags }}"
options=$(echo "$tags" | sed 's/\(.*\)/\1/g')
echo "::set-output name=choice_options::$options"
- name: Run Workflow
run: |
selected_tag="${{ inputs.choice }}"
echo "Selected tag: $selected_tag"
- run: |
echo "Log level: $LEVEL"
echo "Tags: $TAGS"
echo "Environment: $ENVIRONMENT"
env:
LEVEL: ${{ inputs.logLevel }}
TAGS: ${{ inputs.tags }}
ENVIRONMENT: ${{ inputs.environment }}

0 comments on commit 4488ad6

Please sign in to comment.