There is a workaround, it comes however with the downside of needing to specify the ref for the reusable workflow twice, like this:
jobs:
build-push:
uses: <org>/<central-workflow-repo>/.github/workflows/build-push.yml@v1.2 # always change with.workflows-ref, too
with:
workflows-ref: v1.2
secrets:
# can't use GITHUB_TOKEN as its different repo
GH_ACCESSTOKEN: ${{ secrets.GH_ACCESSTOKEN }}
The repo of your reusable workflow has this structure:
<org>/<central-workflow-repo>/ (github repo)
├─ .github/
│ ├─ workflows/
│ │ ├─ build-push.yml
├─ actions/
│ ├─ your-action/
│ │ ├─ action.yml
- Check-out the repo of the called workflow to
workflows
on:
workflow_call:
inputs:
workflows-ref:
description: "ref of the centralized workflows repo that was specified in 'jobs.<name>.uses'"
required: true
type: string
...
steps:
- name: Checkout workflows repo # required so we can reference the actions locally
uses: actions/checkout@v2
with:
ref: ${{ inputs.workflows-ref }}
path: workflows
repository: <org>/<central-workflow-repo>
token: ${{ secrets.GH_ACCESSTOKEN }}
- (optional) if you want your calling repo checked out, do so, but to a subdirectory
- name: Checkout repository
uses: actions/checkout@v2
with:
path: app
- Start referencing your local actions:
- uses: ./workflows/actions/your-action