Answers: <p>First, you must permit the reusable workflow to be called from another organization. <br>
  For that, go to <em>Organization settings -&gt; Actions -&gt; General</em>. Under the policies, select the &quot;<strong>Allow all actions and reusable workflows</strong>&quot; option to use the workflow outside the organization.</p>
  <p><strong>NOTE</strong>: You have to keep the repositories public so that the other organizations can access them.</p>
  <p><a href="https://i.sstatic.net/85K9p.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/85K9p.png" alt="org-settings" /></a></p>
  <p><strong>Now to the work:</strong></p>
  <ol>
  <li>Create a reusable workflow in the GitHub Organization 1: <em><strong>sample_one</strong></em>.</li>
  <li>Now create a trigger workflow in <em><strong>two_repo</strong></em> to call the workflow in <em><strong>one_repo</strong></em> under <em><strong>sample_one</strong></em> organization.</li>
  <li>Now add the trigger parameter under the <em><strong>jobs</strong></em> section inside the workflow and mention the reusable workflow of <em><strong>one_repo</strong></em>.</li>
  </ol>
  <pre class="lang-json prettyprint-override"><code>name: Scan, Build and Deploy
  on:
    push:
      branches: [ &quot;main&quot; ]
  
  jobs:
    trigger:
      uses: sample_one/one_repo/.github/workflows/reusable-workflow.yml@main
  </code></pre>
  <p>Edit the following line according to the location of the reusable workflow.</p>
  <p>That's it! So when the workflow runs in the <em><strong>two_repo</strong></em>, the reusable workflow in the <em><strong>one_repo</strong></em> will be used.</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-01-18T05:57:56.720Z
Answers: 2024-01-19T04:13:02.363Z
Answers: 2024-01-19T04:13:02.363Z
Answers: Ajay
Body: <p>I have a query in regards with Github workflows.</p>
  <p>Consider the below scenario :</p>
  <ul>
  <li><p>Github Organization 1 : <strong>sample_one</strong></p>
  </li>
  <li><p>Github Organization 2 : <strong>sample_two</strong></p>
  </li>
  <li><p>sample_one organization has one repository called : <strong>one_repo</strong></p>
  </li>
  <li><p>sample_two organization has one repository called : <strong>two_repo</strong></p>
  </li>
  </ul>
  <p><strong>Problem Statement :</strong></p>
  <p>one_repo has a reusable workflow that needs to be called by two_repo (that is in different organization) - How do I do this?</p>
  <p>Note :</p>
  <p>The reusable workflow from one_repo maybe updated from time to time.</p>
  <p>Can someone help me with the workflow calls for the same as to how can a repo from some other organization be able to call the resuable workflow from another organization.</p>
  
Tags: <cicd><github><build-pipeline><github-actions>
Title: Github Actions : Reusable workflow across multiple organizations
UserDisplayName: Rezzerk
ThreadText: # Github Actions : Reusable workflow across multiple organizations
  
  (Asked by: username_0 on 2024-01-16)
  
  I have a query in regards with Github workflows.
  
  Consider the below scenario :
  
  * Github Organization 1 : **sample\_one**
  * Github Organization 2 : **sample\_two**
  * sample\_one organization has one repository called : **one\_repo**
  * sample\_two organization has one repository called : **two\_repo**
  
  **Problem Statement :**
  
  one\_repo has a reusable workflow that needs to be called by two\_repo (that is in different organization) - How do I do this?
  
  Note :
  
  The reusable workflow from one\_repo maybe updated from time to time.
  
  Can someone help me with the workflow calls for the same as to how can a repo from some other organization be able to call the resuable workflow from another organization.
  
  **Tags:** cicd, github, build-pipeline, github-actions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-01-18. Score: 0
  
  First, you must permit the reusable workflow to be called from another organization.   
  For that, go to *Organization settings -> Actions -> General*. Under the policies, select the "**Allow all actions and reusable workflows**" option to use the workflow outside the organization.
  
  **NOTE**: You have to keep the repositories public so that the other organizations can access them.
  
  [![org-settings](https://i.sstatic.net/85K9p.png)](https://i.sstatic.net/85K9p.png)
  
  **Now to the work:**
  
  1. Create a reusable workflow in the GitHub Organization 1: ***sample\_one***.
  2. Now create a trigger workflow in ***two\_repo*** to call the workflow in ***one\_repo*** under ***sample\_one*** organization.
  3. Now add the trigger parameter under the ***jobs*** section inside the workflow and mention the reusable workflow of ***one\_repo***.
  
  ```json
  name: Scan, Build and Deploy
  on:
    push:
      branches: [ "main" ]
  
  jobs:
    trigger:
      uses: sample_one/one_repo/.github/workflows/reusable-workflow.yml@main
  
  ```
  
  Edit the following line according to the location of the reusable workflow.
  
  That's it! So when the workflow runs in the ***two\_repo***, the reusable workflow in the ***one\_repo*** will be used.
  
  
  ---
  
  