Skip to content

Commit

Permalink
docs: add info about self hosted runner (nrwl#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav authored Oct 9, 2023
1 parent 27d031a commit fb2e040
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
This Action uses Github API to find the last successful workflow run. If your `GITHUB_TOKEN` has restrictions set please ensure you override them for the workflow to enable read access to `actions` and `contents`:

<!-- start permissions-in-v2 -->
```yaml
jobs:
myjob:
Expand All @@ -112,6 +113,43 @@ jobs:
contents: 'read'
actions: 'read'
```
<!-- end permissions-in-v2 -->

## Self-hosted runners

This Action supports usage of your own self-hosted runners, but since it uses GitHub APIs you will need to grant it explicit access rights:

<!-- self-hosted runners -->
```yaml
# ... more CI config ...
jobs:
myjob:
runs-on: self-hosted
container: my-org/my-amazing-image:v1.2.3-fresh
name: My Job
steps:
- uses: actions/checkout@v3
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
# Mark your git directory as safe
- name: Set Directory as Safe
run: |
git config --system --add safe.directory "$GITHUB_WORKSPACE"
shell: bash
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4

- run: |
echo "BASE: ${{ env.NX_BASE }}"
echo "HEAD: ${{ env.NX_HEAD }}"
# ... more CI config ...
```
<!-- end self-hosted runners -->

## Background

Expand Down

0 comments on commit fb2e040

Please sign in to comment.