docs
docs copied to clipboard
`GITHUB_ACTION_PATH` is underspecified
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/learn-github-actions/variables
What part(s) of the article would you like to see updated?
GITHUB_ACTION_PATH
should mention that the path includes a path if there is one.
Additional information
https://github.com/jsoref/show-action-path/actions/runs/4586308014/jobs/8099062421#step:2:71
GITHUB_ACTION_PATH=/home/runner/work/_actions/jsoref/show-action-path/main
https://github.com/jsoref/show-action-path/actions/runs/4586308014/jobs/8099062371#step:2:71
GITHUB_ACTION_PATH=/home/runner/work/_actions/jsoref/show-action-path/main/test
https://github.com/jsoref/show-action-path/actions/runs/4589129402/jobs/8103813737#step:2:71
GITHUB_ACTION_PATH=/home/runner/work/_actions/jsoref/show-action-path/ambig/uous/test
https://github.com/jsoref/show-action-path/actions/runs/4589129402/jobs/8103813568#step:2:71
GITHUB_ACTION_PATH=/home/runner/work/_actions/jsoref/show-action-path/ambig/uous/test/nested
Note that it isn't possible to distinguish where the end of the reference is from where the path within the repository is.
https://github.com/jsoref/show-action-path/actions/runs/4586308014/jobs/8099062310#step:3:72
GITHUB_ACTION_PATH=/home/runner/work/show-action-path/show-action-path/./
https://github.com/jsoref/show-action-path/actions/runs/4586308014/jobs/8099062475#step:3:72
GITHUB_ACTION_PATH=/home/runner/work/show-action-path/show-action-path/./test
https://github.com/jsoref/show-action-path/actions/runs/4589129402/jobs/8103813842
GITHUB_ACTION_PATH=/home/runner/work/show-action-path/show-action-path/./test/nested
👋 Hey @jsoref - Thanks for opening an issue! I'll get this triaged for review 👀
@cmwilson21: 😦
@jsoref Thanks for the ping! Reopened now 👍
Hey @jsoref, thanks (again) for your patience with us as we work through all of the issues in our backlog. We appreciate it! 🙇♀
So I have been reading this issue for a bit and I am not quite sure what it is requesting.
GITHUB_ACTION_PATH
should mention that the path includes a path if there is one.
I'm wondering if you could clarify this a little bit more for me? Like an example of how people could get tripped up when they are using this variable would probably help me understand a little bit more. Thank you!
@SiaraMist: Actions can either be in the root of a repository, or nested elsewhere. If your action isn't in the root of the repository, then GITHUB_ACTION_PATH
will include the path to the directory (e.g. test/nested
) containing your action definition file (action.yml
/ action.yaml
).
See runs near https://github.com/jsoref/show-action-path/actions/runs/6803939968/job/18500393858
GITHUB_ACTION_PATH=/home/runner/work/_actions/jsoref/show-action-path/main/test/nested
or
https://github.com/jsoref/show-action-path/actions/runs/6803939968/job/18500394278
GITHUB_ACTION_PATH=/home/runner/work/show-action-path/show-action-path/./test
@jsoref thanks for the quick response! ⚡
That part does make sense to me. In the documentation, it says that GITHUB_ACTION_PATH
is "the path where an action is located." I would interpret that as including the path to the specific directory. Is it when that is combined with the advice on how to use it that it becomes confusing? "You can use this path to access files located in the same repository as the action." I could see how that sentence indicates it's just the path to the repo where the composite action is located and not the path to the specific action. Am I on the right track for why this definition is confusing, or am I still missing something?
Yes. That's the problem.
Ok
Thanks for the clarification @jsoref!
We could update the description to say something like:
The path where an action is located. This property is only supported in composite actions. You can use this path to change directories to where the action is located and access other files in that same repository. For example, `/home/runner/work/_actions/repo-owner/name-of-action-repo/v1`.
You or anyone is welcome to open a pull request to make this change.