This repository stores GitHub Action workflow files for reuse. Check below for explanations for each workflow.
A workflow that uses another workflow is referred to as a "caller" workflow. The reusable workflow is a "called" workflow.
To call a reusable workflow, define a job without steps and reference the workflow file in the uses
keyword:
jobs:
your-job-name:
name: A concise name for your job
uses: username/repository/.github/workflows/workflow.yml@main
If a reusable workflow expects Inputs
and Secrets
, they can be passed like this:
...
uses: username/repository/.github/workflows/workflow.yml@main
with:
AN_INPUT: 1234
secrets:
A_MULTILINE_SECRET: |
SECRET1="${{ secrets.SECRET1 }}"
SECRET2="${{ secrets.SECRET2 }}"
ANOTHER_SECRET: ${{ secrets.SECRET3 }}
Note
Inputs
are non-sensitive variables of the type boolean, number or string.
Secrets
are sensitive variables which will not be shown in workflow logs.
A multiline secret can be used to pass an arbitrary amount of secrets to a called workflow, e.g. env variables.
If all required Secrets
are already in any secret store, they can be inherited to the called workflow:
...
secrets: inherit
As soon as one Secret
is explicitly specified, all other Secrets
also have to be specified.