How to combine multiple 'uses' in github actions?

I find myself repeating these three lines.

      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: aahnik/setup-pyproject@main

How can I combine these three ?

In the composite action, “uses” is not allowed…

You can’t. A step can only run one action or task at a time. So you have to list them out separately.


If GitHub Actions supports the fully YAML specification, try Anchors:

I suppose you could specify the list once at the top and then recall it in every job in the same file

Right now the GitHub Actions YAML doesn’t support anchors.