Composite docker action

I would like to write a generic action combining 3 steps, one of which requires to be run with a custom Docker image.

It looks like this:

runs:
  using: "composite"
  steps:
    - uses: actions/checkout@v2
    - uses: jitterbit/get-changed-files@v1
    - run: |
        # commands that need to be run in a container

Can I add something like this below (which is what I use in my standalone action) ?

jobs:
  myjob:
    runs-on: ubuntu-latest
    container:
      image: # my image
    steps:
      - ...

Or should I use a docker action? (but I don’t think I can use actions/checkout@v2 and jitterbit/get-changed-files in it, which is unfortunate)

Can I add something like this below (which is what I use in my standalone action) ?

No as far as I know this exists only on Job level.

However the runner mounts your workspace (with all changes of your previous steps) into the docker action so you should be able to to replace run with uses: docker:// without a custom docker action.

runs:
  using: "composite"
  steps:
    - uses: actions/checkout@v2
    - uses: jitterbit/get-changed-files@v1
    - name: Explain why this job ran
      uses: docker://# my image
      with:
        entrypoint:  # command executable that need to be run in a container
        args:  # args of the command that need to be run in a container

See Workflow syntax for GitHub Actions - GitHub Docs, Workflow syntax for GitHub Actions - GitHub Docs.