Local Action/Workflow with parameters

Hello there
I’ve been looking all morning without look, what I found didn’t seem to be very useful and misses a few important things I need, so I decided to ask.

I want to write a Workflow Dispatch Template or Action to deploy to different environments and regions (dev, test, prod, US, EU, etc.)

How do I write an action or template, local to my repo (for now) that can receive parameters and can be called “as a step” just as Checkout et-al?

For a local action, create a directory and add the action.yml file, plus anything else that might be needed. Then you can call it using the local directory path (must be after checkout!):

      - name: Use local action
        uses: ./my/action

See also: Example: Using an action in the same repository as the workflow

Thanks! I’ll definitely try this next time I’m messing around with the Actions.

1 Like