Skip to content

Get Selected

Actions
Returns a string with the name of the selected checkboxes on a workflow_dispatch event. Separator defaults to
v1.1.1
Latest
Star (18)

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

Get Selected is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

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

Get Selected is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.