Github actions reusing workflows

Hello, i create a reusing workflow on github actions. so when add new same application or service no need create a workflow again.
but still not work to call reusing workflow, how this workflow can work?

i setup like this:

name: WS Core CI

on:
  workflow_dispatch:
    inputs:
      tags:
        description: 'Tag Name (ex : 0.0.1)'
        required: true

jobs:
   workflow-1:
   uses: repo/pipelines/golang@master
   with:
      token: ${{ secrets.GITHUB_TOKEN }}

can give me an sample about that? Thank you

1 Like

The uses syntax is invalid, any reusable workflow must be placed in .github/workflows. The uses syntax should be owner/repo/.github/workflows/workflow_file.yml@master.

2 Likes

okay, but is reusable workflow can call other private repository in same organization?

example:

  • repoA (source code)
  • repoB (pipelines repo)

repoA will call reusable workflow into repoB.

Thanks

1 Like
  • Reusable workflows stored within a private repository can only be used by workflows within the same repository.

- from https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#limitations

1 Like

okay, i will change to composite action. But the action.yml can support triggering?

Thanks

1 Like

The rule is that you can run things that are in your workspace on the build machine. Usually this means they are in your repo. But if you wish, you can have a step that loads things from other repos for which you have permissions and set up secrets to access. Love them to fix place and then reference them in a later step. This allows you to share.

Go to user AmericanAirlines and search for the preload repo. It contains an action you can use to preload one or more other repos to use their content.

2 Likes

okay, i will search it soon. Thank you

But in this repo can call or running workflows or action where place on other repository?

1 Like

It’s just an action to LOAD other content. Once the other repos are loaded you have to do what you want. But you can call something that you loaded.

1 Like