I'm setting up a reusable workflow using GitHub actions: https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
Since the calling workflow and called workflow are both in the same repo, I want to reference the latest commit of the called workflow inside my calling workflow's uses statement.
Example:
uses: owner/repo/.github/workflows/called-workflow.yml@${{GITHUB_SHA}}
That ${{GITHUB_SHA}} doesn't get interpolated, so I get the following error:
Invalid workflow file : .github/workflows/calling-workflow.yml#L1
handling usage of workflow "owner/repo/.github/workflows/called-workflow.yml@${{GITHUB_SHA}}": can't obtain workflow file: reference to workflow should be either a valid branch, tag, or commit
How can I set the ref to the latest commit when calling a workflow within a workflow?