I was excited to see that composite actions can now uses `uses`, until

… until I found out that if still can’t be used. So there’s no way to skip a uses step within a composite action if it’s not needed.

My use case is a “setup tools” action that will install and setup caches for the versions of PHP, Composer, Node, and Pnpm we need by reading them from a config file in the repo. But some actions only need PHP or Node, it’d be nice to skip installing the one we don’t need.

For those who haven’t seen the announcement yet: GitHub Actions: Reduce duplication with action composition | GitHub Changelog


Same for me, couldn’t wait to build my first composite action only to find out:
Unexpected value 'if'

Why is if not supported? This is a must have to make real composite actions.

@anomiex Maybe good to rephrase the title of this post to something like: Composite actions don't allow if conditions. This way it’s easier to find.

There is an issue about this in the actions/runner repository:

It looks like if has now been added for composite actions. The issue mentioned by @ airtower-luna is closed. See it at add conditional execution of action steps · Issue #834 · actions/runner · GitHub. It also looks like it if might not be added to the documentation yet, but that there’s a PR for the docs being reviewed at Add documentation for conditional composite steps (`runs.steps[*].if`) by fhammerl · Pull Request #12378 · github/docs · GitHub.