Feature Request: Context availability in `jobs.<job_id>.uses`

According to the official context availability list, it is not possible to use any context in jobs.<job_id>.uses. When reusing workflows within the same repository, e.g. slightly different behaviour on PR or push, it makes the uses reference unnecessary verbose and rigid.

Alternative 1

The {repo}/{owner} and {ref} part of the reference could have good defaults, e.g. the same repository and the “current” branch, e.g. default branch for scheduled workflows or pushed-to branch.

Alternative 2

These pieces of information are available in the github context as github.repository and github.ref_name. If the context was available within the calling workflow, it could be possible to write something similar to:

jobs:
  caller:
    uses: ${{ github.repository }}/.github/workflows/common.yml@${{ github.ref_name }}
2 Likes

This is increasingly important/needed now that internal actions can be shared within an enterprise.