-
Notifications
You must be signed in to change notification settings - Fork 989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Index was out of range
in local composite action poststeps
#2816
Comments
could be related to
Those are problems with the provided contextdata like inputs and steps in post steps of local composite actions. I think it is good to make those problems of local composite actions more visible |
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days. |
Ran into this issue today and it is horrible mostly because you do not understand what is wrong - you search for problems in your workflow and not for internal problems in actions. We have a build where we compare screenshots from a PR branch to screenshots from the target branch to see what has changed. To avoid storing and updating screenshots, one job in the build creates screenshots from the PR branch and another job checks out the target branch and runs the same screenshots for that. Now this all works fine until today when I wanted to remove one extra step from a global "setup" composite. Apparently the post action uses the cache from the target branch where it then has a different number of steps, and it fails with the cryptic C# "Index was out of range" error message. After force merging the update to the "setup" composite, it all works properly again. |
Describe the bug
Invoke a local composite action like
The post steps fail with
Error: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
To Reproduce
Create a workflow
Create a composite action that invokes
actions/checkout
After creating the files, create the tag
v1
.Then update the composite action to change the number of steps.
Run the workflow with input
ref=v1
Expected behavior
Expect the poststeps to not fail.
Runner Version and Platform
What's not working?
Post steps fail, which causes workflow status to fail.
Job Log Output
Workarounds
This error is caused by a mismatch in the cached number of steps for the local composite action. Calling checkout causes the number of steps to change, which creates the error. To workaround...
uses: user/repo/.github/actions/composite@main
)The text was updated successfully, but these errors were encountered: