google / google/osv-scanner-action
Add workflow input to set environment variables
- Dominant language
- Python
- Stars
- 96
- Forks
- 40
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 4
Description
We have a Go dependency that needs credentials to access. This causes the code analysis to fail:
```
Failed to run code analysis (govulncheck) on '/github/workspace/go.mod' because govulncheck: loading packages:
There are errors with the provided package patterns:
pkg/database/migrations.go:15:2: riverqueue.com/riverpro/driver@v0.19.0: reading https://riverqueue.com/goproxy/riverqueue.com/riverpro/driver/@v/v0.19.0.zip: 401 Unauthorized
```
To fix this, we need to set
```
GOPROXY: https://proxy.golang.org,https://river:${{ secrets.RIVER_PRO_SECRET }}@riverqueue.com/goproxy,direct
GONOSUMDB: riverqueue.com/riverpro
```
Unfortunately reusable workflows don't inherit the top-level `env` setting from the calling workflow. It would be nice if this could be an input to the reusable workflows.
EDIT: The `secrets` context is not available when setting inputs to reusable workflows; to make this possible I think this means the workflows would need to be extracted to composite actions 😖
Contributor guide
Assessment
This issue has not been assessed yet.