Skip to content

Copy action from another repo during workflow #25607

Answered by laughedelic
eb250130 asked this question in Actions
Discussion options

You must be logged in to vote

Yes, you can use the usual checkout action to do it. Here is an example:

    steps:
      - uses: actions/checkout@v2
  - name: Checkout private actions
    uses: actions/checkout@v2
    with:
      repository: org/shared-private-actions
      path: .github/shared-actions
      token: ${{ secrets.PRIVATE_ACCESS_TOKEN }}

  - uses: ./.github/shared-actions/action-name
    with:
      # inputs

Notice that you need to generate a token that has access to the private repository with actions and add it as an org/account secret.

You can have multiple actions in a single repository in separate folders, then you can check it out once and use any of them. Or you can have a repository per action, …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants