-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entrypoint is the workflow name #11
Comments
Reopening because we can't rely on We'll need to figure out a different way to get the path to the user workflow. We can't rely on The only thing I can thing of right now is checking out the user repository and looking for the i.e.
I'm not really sure that the workflow name even uniquely identifies the workflow being executed. |
I created a pending topic on github.community to see if there is a way to reliably get the workflow path but I wonder if there aren't other avenues to submit feature requests. |
In testing the workflow names can be the same for multiple workflows in the same repo so the workflow name by itself won't uniquely identify the workflow being run. |
It seems that you can query the action run via Github with the run ID and get the workflow path from there. get_workflow_path() {
action_run=$(mktemp_json)
if call_curl \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" > "$action_run"; then
workflow_url=$(jq -r '.workflow_url // empty' "$action_run")
if [ -n "$workflow_url" ]; then
workflow_json=$(mktemp_json)
if call_curl \
"$workflow_url" > "$workflow_json"; then
jq -r .path "$workflow_json" via: |
The relevant docs for the API endpoints are here Not sure yet how authentication with the API would work since I'm pretty sure you need some kind of auth or permissions to read them. |
GitHub Actions have |
neat solution! You can use the gh CLI to play with it too (set GH_TOKEN=THE_TOKEN to make it work non-interactively) |
Yeah, I've since written something and got it working. It requires adding I don't really like where the API is going adding parameters to functions and such so I'm trying a refactor in #47 which should hopefully be a bit easier to work with and not create lots of backwards incompatibilities over time. It should also address some of the thoughts @laurentsimon had on #13. I'll try to add more info to the PR there to make it more clear how it's supposed to work before un-drafting it, but feel free to comment early if you have thoughts. |
At it stands the provenance
invocation.entryPoint
is set to theworkflow
field from the Github Actions workflow. This is the name of the calling workflow or the path if the name is not set.This seems wrong to me. I think the path to the calling workflow yaml file would be more useful but I'm not sure. We could get from
event.workflow
in the github context.The text was updated successfully, but these errors were encountered: