unable to inject shell to composite action
See original GitHub issueDescribe the bug Unable to pass the shell via input parameter to the composite action.
To Reproduce Steps to reproduce the behavior:
- create following composite action:
name: 'test actions'
description: 'test action description'
inputs:
shell:
description: 'shell to use'
required: false
default: bash
runs:
using: "composite"
steps:
- name:
run: echo "bla bla bla"
shell: ${{ inputs.shell}}
- use the action in some workflow
- Job fails on the ‘Set up job’ phase, printing the following errors:
Current runner version: '2.274.2'
Operating System
Virtual Environment
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'msys2/setup-msys2@v2'
Download action repository 'actions/checkout@main'
Download action repository 'myci-actions/add-pacman-repo@master'
Error: myci-actions\add-pacman-repo\master\action.yml (Line: 25, Col: 14):
Error: myci-actions\add-pacman-repo\master\action.yml (Line: 25, Col: 14): Unrecognized named-value: 'inputs'. Located at position 1 within expression: inputs.shell
Error: GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. myci-actions\add-pacman-repo\master\action.yml (Line: 25, Col: 14): Unrecognized named-value: 'inputs'. Located at position 1 within expression: inputs.shell
at GitHub.DistributedTask.ObjectTemplating.TemplateValidationErrors.Check()
at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String f[...]
Error: Fail to load myci-actions\add-pacman-repo\master\action.yml
where (Line: 25, Col: 14)
corresponds to the last line of the action from step 1. I.e. shell: ${{ inputs.shell}}
Expected behavior The action works fine and uses the shell passed in as input argument to the action.
Runner Version and Platform
windows-latest
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Github composite action output can not be set from within a ...
For one of my projects, I am setting an action output from within a bash script that is executed inside a composite action....
Read more >GitHub Composite Actions - STOP wasting your time and ...
A composite run steps action allows you to combine multiple workflow run steps within one action. ... Your browser can't play this video....
Read more >Creating a GitHub Composite Action
Composite actions allow you to combine multiple steps into one. The current Sonarcloud YAML I use is below – it's fairly long and...
Read more >Composite Actions vs Reusable Workflows
Reusable workflows have many limitations that aren't mentioned here, and their only real advantage is the ability to execute steps in parallel ...
Read more >GitHub Actions Security Best Practices [cheat sheet included]
Learn how to secure your GitHub Actions with these best practices! From controlling credentials to using specific action version tags, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, rather than duplicating steps, I ended up sym-linking OS-specific shells to a known location, and changed my steps to specify that new location as
shell
parameter.Not ideal, but not as ugly as duplicating each and every step.
We are still experiencing this issue using ubuntu-latest runners.
Workflow