This repository contains test workflows for GitHub Actions workflow_dispatch triggers.
The workflow .github/workflows/test-dash-params.yml tests whether workflow_dispatch input parameters can have dashes in their names and which syntax variations work for accessing them.
- dry-run: A parameter with a dash in the name
- dry_run: A parameter with an underscore in the name
The workflow includes four conditional steps that test different syntaxes:
- Test 1:
inputs.dry-run- Dot notation with dash (may not work) - Test 2:
inputs['dry-run']- Bracket notation with dash (expected to work) - Test 3:
inputs.dry_run- Dot notation with underscore (expected to work) - Test 4:
inputs['dry_run']- Bracket notation with underscore (expected to work)
- Go to the Actions tab in GitHub
- Select the "Test Workflow Dispatch with Dashed Parameters" workflow
- Click "Run workflow"
- Set the parameters to 'true' to enable the corresponding test steps
- Click "Run workflow" to execute
The steps that execute will show which syntaxes successfully work for accessing the parameters.