question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs: using a GitHub Action from another private repository

See original GitHub issue

I think it would be great to update our README to showcase how to use a GitHub Action from another private repository.

As of actions/checkout@v2-beta, it is possible to checkout a different private repository:

https://github.com/actions/checkout#checkout-a-different-private-repository

If the just-cloned private repository is a Docker container action containing a Dockerfile, action metadata file, and entrypoint, it’s possible to run it since uses syntax supports citing actions in the same repository as the workflow:

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-using-action-in-the-same-repository-as-the-workflow

Example:

name: CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2-beta
      with:
        # Private version of https://github.com/actions/hello-world-docker-action
        repository: USER/private-hello-world-docker-action
        ref: refs/tags/v1
        token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret that contains your PAT to clone that private repo
    - name: Run the private action
      uses: ./
      with:
        who-to-greet: "Mona the Octocat"

If the team is open to getting this documented, I’m happy to cut a PR. ✌️

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:62
  • Comments:26 (1 by maintainers)

github_iconTop GitHub Comments

87reactions
shreyaspurohitcommented, Jun 3, 2021

i am surprised this is not yet supported. For a lot of orgs with private repo’s this is going to be useful. I am hopeful that it comes back on a near roadmap.

36reactions
robinjhectorcommented, May 16, 2020

Thanks for the documentation! Are there any concrete plans to support private actions natively in GH Actions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sharing actions and workflows from your private repository
You can share actions and reusable workflows from your private repository, without publishing them publicly, by allowing GitHub Actions workflows to access a ......
Read more >
Managing GitHub Actions settings for a repository - GitHub Docs
On GitHub, navigate to the main page of the private repository. · Under your repository name, click Settings. · In the left sidebar,...
Read more >
Sharing workflows, secrets, and runners with your organization
Learn how you can use organization features to collaborate with your team, by sharing starter workflows, secrets, and self-hosted runners.
Read more >
Reusing workflows - GitHub Docs
The called workflow is stored in a private repository and the settings for that repository allow it to be accessed. For more information,...
Read more >
Call actions and workflow of private repository #16243 - GitHub
It is possible to call actions of private repositories. However, calling workflows of private repositories is not possible. Are there any plans on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found