Skip to content

Docs: using a GitHub Action from another private repository #95

Closed
@francisfuzz

Description

@francisfuzz

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. ✌️

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions