Skip to content
check-square

GitHub Action

Get Selected

v1.1.1 Latest version

Get Selected

check-square

Get Selected

Returns a string with the name of the selected checkboxes on a workflow_dispatch event. Separator defaults to " "

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get Selected

uses: joao-zanutto/[email protected]

Learn more about this action in joao-zanutto/get-selected

Choose a version

Get Selected

GitHub Super-Linter CI

This action returns a list with the names of selected checkboxes from the input of a workflow_dispatch event. It supports the use of custom separator strings and an ignore list, which will be ignored from the output.

Usage

Here's an example of how to use this action in a workflow file:

on:
  workflow_dispatch:
    inputs: # Example inputs
      api:
        type: boolean
      worker1:
        type: boolean
      worker2:
        type: boolean

jobs:
  get-selected:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - id: get-selected-step
        uses: joao-zanutto/[email protected]

      - run: echo ${{ steps.get-selected-step.outputs.selected }}

Working example

Running the workflow:

image

Will generate the following output:

image

Referencing the output on a different job

jobs:
  get-selected:
    runs-on: ubuntu-latest
    outputs: # Set this to consume the output on other job
      selected: ${{ steps.get-selected-step.outputs.selected}}
    steps:
      - uses: actions/checkout@v4

      - id: get-selected-step
        uses: joao-zanutto/[email protected]

  consume-on-another-job:
    runs-on: ubuntu-latest
    needs: get-selected
    steps:
      - run: echo ${{ needs.get-selected.outputs.selected }}

Inputs

Input Required Default Description
ignore false null Comma-separated options to ignore
format false 'list' Output format. list or json
separator false ' ' Separator; only vaid for format: list

Outputs

Output Description
selected Names of the selected checkboxes