Use action from current repo before checkout


I tried to use an own-backed action from the workflow repository. Goal is to have action sources, workflow sources, and app sources aligned on all commits & branches.

From what I got from this thread, it is possible to either:
[1] use the action before checking out the repo, by passing the whole ref like that in my_workflow.yml

    - name: Test my action
      uses: my_org/my_repo/.github/actions/my_action@branch_name

Having the branch name fixed defeats the point to have the actions sources within the app repo: with this example, when an user will trigger a pull-request, the action source will be taken from branch_name instead of the pull-request branch.
Obvious solution would be to use in my_workflow.yml

    - name: Test my action
      uses: my_org/my_repo/.github/actions/my_action@${{ github.ref }}

But that leads to following error:

Invalid workflow file
The workflow is not valid. .github/workflows/my_workflow.yml (Line: 19, Col: 13): Unrecognized named-value: 'github'. Located at position 1 within expression: github.ref

[2] proceed the repo checkout before invoking the action.
As we indeed want to factor the checkout part in an action, this would be useless.

Is there a third solution I missed?

Thanks in advance,