Skip to content

Instantly share code, notes, and snippets.

@Moose0621
Created August 13, 2020 14:51
Show Gist options
  • Select an option

  • Save Moose0621/b28867723dcba3e36ab2f438e59bf6d8 to your computer and use it in GitHub Desktop.

Select an option

Save Moose0621/b28867723dcba3e36ab2f438e59bf6d8 to your computer and use it in GitHub Desktop.
# Using a Private Action
You can run a private action in a separate repository using a separate checkout step with a PAT and running it as a local action.
An action like:
```yaml
- name: My Action
uses: joshmgross/private-action@v1
with:
input1: value1
```
Becomes:
```yaml
- name: Checkout Private Action
uses: actions/checkout@v2
with:
repository: joshmgross/private-action # The repo containing the private action
ref: v1 # The ref/version of the private action
token: ${{ secrets.REPO_PAT }} # PAT with read access to the private action's repo
path: my-private-action
persist-credentials: false
- name: Run Private Action
uses: ./my-private-action # Must match path above and include ./
with:
input1: value1 # Action inputs
```
See [Creating secrets docs](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets) for info on adding a PAT to your repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment