Consider a GitHub Action composite action, like (snippet only):
runs:
using: "composite"
steps:
- uses: azure/login@v2
with:
client-id: ${{ inputs.clientId }}
tenant-id: ${{ inputs.tenantId }}
allow-no-subscriptions: true
- name: Get Token
id: get-token
run: |
token=$(az account get-access-token --scope=${{ inputs.ammaScope }} --query accessToken --output tsv)
echo "::add-mask::$token"
echo "token=$token" >> "${GITHUB_OUTPUT}"
shell: bash
I’m confused about the following:
- Does each step run in a separate Bash shell (
shell: bash
)? Normally, all steps within a job runs in the same shell. If yes, is this the same shell, as the other steps in the invoking job? - Is it possible for composite actions to export environment variables (
export MY_VAR=MY_VALUE
), or can it only communicate with the other steps in the invoking job via outputs? - How can I get rid of warnings about: “
pre
execution is not supported for local action from ‘./.github/actions/register-api'”?
I think the following references don’t describe the above. Where can I lookup for technical details of composite actions?
References:
- https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-actions
- https://docs.github.com/en/actions/creating-actions/creating-a-composite-action