Skip to content

Add workflow input to set environment variables #110

Description

@haines

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 😖

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions