Skip to content

Commit 136a6bd

Browse files
bradynpoulsenSarah Edwards
andauthored
Actions Docs: Using workflows from other private repositories (#3627)
Co-authored-by: Sarah Edwards <skedwards88@github.com>
1 parent a712ef3 commit 136a6bd

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

content/actions/reference/workflow-syntax-for-github-actions.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,27 @@ jobs:
638638
uses: docker://gcr.io/cloud-builders/gradle
639639
```
640640

641+
#### Example using action inside a different private repository than the workflow
642+
643+
Your workflow must checkout the private repository and reference the action locally.
644+
645+
{% raw %}
646+
```yaml
647+
jobs:
648+
my_first_job:
649+
steps:
650+
- name: Check out repository
651+
uses: actions/checkout@v2
652+
with:
653+
repository: octocat/my-private-repo
654+
ref: v1.0
655+
token: ${{ secrets.GITHUB_TOKEN }}
656+
path: ./.github/actions/my-private-repo
657+
- name: Run my action
658+
uses: ./.github/actions/my-private-repo/my-action
659+
```
660+
{% endraw %}
661+
641662
### `jobs.<job_id>.steps[*].run`
642663

643664
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.

0 commit comments

Comments
 (0)