From df9f1faf8d86bcfc50f9ac519e7108cfb89f1e12 Mon Sep 17 00:00:00 2001 From: Bradyn Poulsen Date: Thu, 11 Feb 2021 17:20:48 -0700 Subject: [PATCH 1/3] docs: Using workflows from other private repositories --- .../workflow-syntax-for-github-actions.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/content/actions/reference/workflow-syntax-for-github-actions.md b/content/actions/reference/workflow-syntax-for-github-actions.md index a13f44a2b48d..de877139159d 100644 --- a/content/actions/reference/workflow-syntax-for-github-actions.md +++ b/content/actions/reference/workflow-syntax-for-github-actions.md @@ -604,6 +604,25 @@ jobs: uses: docker://gcr.io/cloud-builders/gradle ``` +#### Example using action inside a different private repository as the workflow + +Your workflow must checkout the private repository and reference the action locally. + +```yaml +jobs: + my_first_job: + steps: + - name: Check out repository + uses: actions/checkout@v2 + with: + repository: octocat/my-private-repo + ref: v1.0 + token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }} + path: ./.github/actions/my-private-repo + - name: Run my action + uses: ./.github/actions/my-private-repo/my-action +``` + ### `jobs..steps[*].run` Runs command-line programs using the operating system's shell. If you do not provide a `name`, the step name will default to the text specified in the `run` command. From 8660eaa5490d474b823cd0afcf65224da09af759 Mon Sep 17 00:00:00 2001 From: Bradyn Poulsen Date: Thu, 11 Feb 2021 17:37:15 -0700 Subject: [PATCH 2/3] #3627 - Escape substitution using raw code example --- content/actions/reference/workflow-syntax-for-github-actions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/actions/reference/workflow-syntax-for-github-actions.md b/content/actions/reference/workflow-syntax-for-github-actions.md index de877139159d..0dac49e9b463 100644 --- a/content/actions/reference/workflow-syntax-for-github-actions.md +++ b/content/actions/reference/workflow-syntax-for-github-actions.md @@ -608,6 +608,7 @@ jobs: Your workflow must checkout the private repository and reference the action locally. +{% raw %} ```yaml jobs: my_first_job: @@ -622,6 +623,7 @@ jobs: - name: Run my action uses: ./.github/actions/my-private-repo/my-action ``` +{% endraw %} ### `jobs..steps[*].run` From 60d30d19b283fa6f7cbfd70b378fe808634ebaa8 Mon Sep 17 00:00:00 2001 From: Sarah Edwards Date: Thu, 4 Mar 2021 09:53:55 -0800 Subject: [PATCH 3/3] Apply suggestions from code review --- .../actions/reference/workflow-syntax-for-github-actions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/actions/reference/workflow-syntax-for-github-actions.md b/content/actions/reference/workflow-syntax-for-github-actions.md index 3326aa707a5c..bd18c991d203 100644 --- a/content/actions/reference/workflow-syntax-for-github-actions.md +++ b/content/actions/reference/workflow-syntax-for-github-actions.md @@ -619,7 +619,7 @@ jobs: uses: docker://gcr.io/cloud-builders/gradle ``` -#### Example using action inside a different private repository as the workflow +#### Example using action inside a different private repository than the workflow Your workflow must checkout the private repository and reference the action locally. @@ -633,7 +633,7 @@ jobs: with: repository: octocat/my-private-repo ref: v1.0 - token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} path: ./.github/actions/my-private-repo - name: Run my action uses: ./.github/actions/my-private-repo/my-action