[Feature Request] Get source repo of reusable workflow easily #38659
Replies: 11 comments 4 replies
-
|
Hi there @joemarshall and welcome to our community! Thank you for this feature request! |
Beta Was this translation helpful? Give feedback.
-
|
We need |
Beta Was this translation helpful? Give feedback.
-
|
+1 this! It's been really inconvenient to require OIDC token perms just to figure out the reusable workflow's name and ref |
Beta Was this translation helpful? Give feedback.
-
|
And now with the new restriction introduced by https://github.blog/changelog/2023-06-15-github-actions-securing-openid-connect-oidc-token-permissions-in-reusable-workflows/ It is breaking changing every workflows that use nested workflows with this workaround.... It's a nightmare to work with Github actions and trying to be stable, mixing workaround for basic needs and dealing with breaking changes every month |
Beta Was this translation helpful? Give feedback.
-
|
Any news on this topic ? |
Beta Was this translation helpful? Give feedback.
-
|
@ossanna16 how can we help to make progress on this feature request? |
Beta Was this translation helpful? Give feedback.
-
|
Any chance to have this feature done in 2025? |
Beta Was this translation helpful? Give feedback.
-
|
+1 for this feature! I have a workflow in a repo that is intended to be used by other repos and having to specify the repo and ref as inputs is clunky to say the least. Perhaps add an action type that behaves similarly to composite, but makes it run in a completely isolated runner with its own context? |
Beta Was this translation helpful? Give feedback.
-
|
It's been a real PITA working with reusable workflows because of this - basically any script that the workflow will run has to be either:
The use-case is as simple as wanting to have a script written in any foreign language that we want to keep in its own file - so people can test it with the language-specific tooling outside of the GitHub Action runtime, but also to get linting etc. Basically the equivalent of something as simple as I would love to have feedback from the team on this issue - is it simply considered low-priority ? Or is it a problem you are planning to solve by making a bigger redesign (like cloning the whole callee workflow repo & exposing the cloned path, as is the case with composite actions) ? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, As OIDC is not available to workflows triggered by pull_request from forks for security reasons. This is totally impossible to use reusable workflow in fork context. It is a shame that GitHub does not propose a viable solution to use Reusable workflow. For the moment we can just use reusable workflows in the same repository or without using forks so basically in rarely useless cases. @ossanna16, can you help on finding people who can help us on this blocking point. |
Beta Was this translation helpful? Give feedback.
-
|
I was poking around at worker logs, and it looks like this is information is available on the runner, it's just not exposed in any of the contexts yet. For example, you should see something like this in Job Message that appears in the worker logs, along with other interesting information: {
// ...
"variables": {
// ...
"system.workflowFileFullPath": {
"value": "my/shared-actions-repo/.github/workflows/ci.yml"
},
// ...
"system.workflowFileRef": {
"value": "refs/heads/test-workflow-sha"
},
"system.workflowFileSha": {
"value": "39600ce582c1eea949d4819f2a0f86c5b508bd0b"
},
// ...
},
// ...
"contextData": {
"github": {
"t": 2,
"d": [
// ...
{
"k": "workflow_ref",
"v": "my/app-repo/.github/workflows/ci.yml@refs/pull/2/merge"
},
{
"k": "workflow_sha",
"v": "8f7839e19bb30f05310af99fb57cd54043e85adb"
}
],
// ...
},
// ...
}
}The So the good news is this could probably be implemented within actions/runner without any backend changes. But the bad news is that even "simple" runner changes can be really hard to land 😭 Perhaps in the meantime we could make an action that extracts this information from the log, similar to get-job-uuid? 🤞 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In OIDC, there is a property: job_workflow_repo_ref which links back to the current reusable workflow.
There are all sorts of reasons why you might want to know what version of the current workflow is running, e.g. to get hold of supplementary files, call other workflows etc.
Please please, pretty please, could you expose this into the main github context by default, so we don't have to hack things with OIDC tokens to get it.
There's a discussion of this on here, but I can't find any explicit feature request
#31054
Beta Was this translation helpful? Give feedback.
All reactions