A GitHub Action that wraps actions/checkout
to checkout multiple additional repositories.
- uses: actions/checkout@v2
- name: Checkout private actions
uses: vweevers/multi-checkout-action@v1
with:
token: ${{ secrets.GITHUB_MACHINE_TOKEN }}
repositories: |
my-org/example-action
my-org/another-action@v3.1.0
my-org/third-action
Space separated lists work too. Very useful when retrieving the list with another step and chaining things.
- uses: actions/checkout@v2
- name: Checkout private actions
uses: vweevers/multi-checkout-action@v1
with:
token: ${{ secrets.GITHUB_MACHINE_TOKEN }}
repositories: my-org/example-action my-org/another-action@v3.1.0 my-org/third-action
The private actions can then be used like so:
- name: Example
uses: ../my-org/example-action
The token must have read access to the repositories. In the case of private repositories you'll want to create a machine user, add the machine user to the repositories that you want to checkout and then generate a token for the machine user. Alternatively use deploy keys via the ssh-key
input.
repositories
: newline-or-space-separated repositories in the form ofowner/name
(to checkout the default branch) orowner/name@ref
whereref
is a branch name, tag or SHA to checkout.path
: relative path under$GITHUB_WORKSPACE
to place the repositories. Default is..
so that repositories are cloned to../owner/name
.
Other inputs are forwarded to actions/checkout
(excluding repository
, ref
and persist-credentials
which is always false
).