Skip to content
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

Issue when share workflow within organization #123

Closed
Jasstkn opened this issue Feb 2, 2021 · 5 comments · Fixed by #394
Closed

Issue when share workflow within organization #123

Jasstkn opened this issue Feb 2, 2021 · 5 comments · Fixed by #394

Comments

@Jasstkn
Copy link

Jasstkn commented Feb 2, 2021

Configuration file for labeler can't be copied if you use shared workflow within the organization.
Is there any way to put configuration inside the workflow?

@MaksimZhukov
Copy link
Contributor

Hello @Jasstkn !
Here is statement from Reusing workflows GitHub documentation article:

If you reuse a workflow from a different repository, any actions in the called workflow run as if they were part of the caller workflow. For example, if the called workflow uses actions/checkout, the action checks out the contents of the repository that hosts the caller workflow, not the called workflow.

According to the documentation, your configuration file has to be in the same repository as caller workflow. Alternatively, you can clone the repository with the called workflow using the checkout action:

- uses: actions/checkout@v3
  with:
    repository: 'Repository name with owner. For example, actions/checkout'

Please see the GitHub documentation for more examples.

@MaksimZhukov
Copy link
Contributor

I’m closing the issue. Please let us know if you have any questions.

@jtmullen
Copy link

Hi @MaksimZhukov I have this same issue and I am confused by this solution you propose:

According to the documentation, your configuration file has to be in the same repository as caller workflow. Alternatively, you can clone the repository with the called workflow using the checkout action

It appears this action it hard-coded to make a request to the caller repo to get the labeler configuration. How does checking out the called repo (where my shared configuration lives) solve this?

@lrstanley
Copy link
Contributor

@jtmullen just FYI, https://github.com/actions/labeler/releases/tag/v4.3.0 / #394 has added support for configuration-path to look at the local filesystem, before making the API call to the repo directly. This means you can clone the central repo down first, and directly reference it inside of the action.

Can see an example of how I'm accomplishing the same here (.github being the repo where I keep my config):

https://github.com/lrstanley/.github/blob/f163452238082e6c5af52edab262253cbaaaaf99/.github/workflows/triage.yml#L49-L66

@Jaycon80
Copy link

Jaycon80 commented Oct 13, 2023 via email

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants