How to run a repo workflow on terminal template creation?

New to workflows and actions I think Im going down a rabbit hole. I’ve created a template I’d like to use for my org with the terminal command:

gh repo create foo --template="org/template"

I’ve read so much docs and Q&As I’m confused. From what I gather I can create a custom action repo with a Dockerfile and a bash .sh file. In the bash file would be a cURL command with the passed $foo.

In the template repo would be the .yml workflow:

name: Pull API
on: create
jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: org/api-action@main

If the API successfully retrieves data I want it to write a file to the repo it’s creating named something like api-results.json. One of the params from the API’s JSON would rename the repo (possibly from a shell command) and update the sidebar tags and the about area.

I already use the API in a bash file from the terminal from a written cURL command but I’m unsure how to pass the passed value to the workflow in the template and built a new repo if it doesn’t exist.

Haven’t found any tutorials on Medium or Egghead that could assist nor any Marketplace references on something similar. Any ideas how-to, from the terminal command, pass the command after create to an API and build a repo from the results?