Reusable workflows with local actions are not working. Reusable workflow is trying to locate the local action in the main repo
Created sample repositories to reproduce the issue
This is the PR link -> https://github.com/vinodsai-a/github-example-repo/pull/1
Error -> https://github.com/vinodsai-a/github-example-repo/pull/1/checks

Update: you can use below workaround on github.com and GHE Server v3.9+ without the input 'workflows-ref' and instead use github.workflow_ref (doc) or the env-var GITHUB_WORKFLOW_REF (doc). thanks @Philip Couling
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/[email protected] # 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
workflowson:
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 }}
- name: Checkout repository
uses: actions/checkout@v2
with:
path: app
- uses: ./workflows/actions/your-action
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With