Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set callable test options from GitHub repository secret #333

Open
JeffResc opened this issue Nov 4, 2024 · 0 comments
Open

Unable to set callable test options from GitHub repository secret #333

JeffResc opened this issue Nov 4, 2024 · 0 comments

Comments

@JeffResc
Copy link
Member

JeffResc commented Nov 4, 2024

I am unable to set a UDS variable from a GitHub repository secret, which would be helpful for loading in secrets such as license keys. Unfortunately, GitHub does not have a way to use a secret as part of a workflow input resulting in this limitation.

Some sort of workaround for this would be helpful for packages that require a secret in order to be tested.

For example:

validate:
  needs: check-flavor
  strategy:
    fail-fast: false
    matrix:
      type: [install, upgrade]
      flavor: [upstream, unicorn, registry1]
    uses: defenseunicorns/uds-common/.github/workflows/callable-test.yaml@d59b1c601730bfa7ab76439643242358e529603e  # v1.2.2
    with:
      runsOn: ubuntu-latest
      upgrade-flavors: ${{ needs.check-flavor.outputs.upgrade-flavors }}
      flavor: ${{ matrix.flavor }}
      type: ${{ matrix.type }}
      options: "--set EXAMPLE_LICENSE_KEY=${{secrets.EXAMPLE_LICENSE_KEY}}"
    secrets: inherit # Inherits all secrets from the parent workflow.

Resulting error:

The workflow is not valid. .github/workflows/test.yaml (Line: 65, Col: 16): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.EXAMPLE_LICENSE_KEY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant