Skip to content

Commit 611adf2

Browse files
author
Alex Boten
authored
Merge pull request #2 from v1v/feature/add-auth
Add support for private repositories with a GitHub token
2 parents 1dec23d + 6fde8c9 commit 611adf2

File tree

5 files changed

+207
-0
lines changed

5 files changed

+207
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,23 @@ This action outputs Github Action workflows and jobs details to OTLP via gRPC.
1414

1515
**Optional** Additional header configuration to pass in as metadata to the gRPC connection.
1616

17+
## `repo-token`
18+
19+
**Optional** Token to use to authorize access to private repositories. Typically the `GITHUB_TOKEN` secret, with `checks:read` access.
20+
1721
## Example usage
1822

1923
```
2024
uses: codeboten/github-action-to-otlp@v1
2125
with:
2226
endpoint: 'grpc.otlpendpoint.io:443'
2327
```
28+
29+
## Example usage in a private repository
30+
31+
```
32+
uses: codeboten/github-action-to-otlp@v1
33+
with:
34+
endpoint: 'grpc.otlpendpoint.io:443'
35+
repo-token: ${{ secrets.GITHUB_TOKEN }}
36+
```

action.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ inputs:
77
headers:
88
description: "Headers to configure gRPC metadata"
99
required: false
10+
repo-token:
11+
description: 'The GITHUB_TOKEN secret'
12+
required: false
1013
runs:
1114
using: "docker"
1215
image: "Dockerfile"
1316
env:
1417
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ inputs.endpoint }}
1518
OTEL_EXPORTER_OTLP_HEADERS: ${{ inputs.headers }}
19+
GITHUB_TOKEN: ${{ inputs.repo-token }}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ require (
1010
go.opentelemetry.io/otel v1.0.0
1111
go.opentelemetry.io/otel/sdk v1.0.0
1212
go.opentelemetry.io/otel/trace v1.0.0
13+
golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0
1314
)

0 commit comments

Comments
 (0)