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

gh: secret not working for file or cmd #48

Open
chrira opened this issue Sep 5, 2024 · 0 comments
Open

gh: secret not working for file or cmd #48

chrira opened this issue Sep 5, 2024 · 0 comments

Comments

@chrira
Copy link

chrira commented Sep 5, 2024

Unfortunately secret is only working for env variables.

I tried to use all different types of secret.

What works is the env var:

export GITHUB_API_TOKEN=my-working-token

dagger call --mod github.com/aweris/daggerverse/[email protected] run --token=env:GITHUB_API_TOKEN --cmd="issue list --repo=dagger/dagger" stdout

When I try to use it with cmd, it fails:

dagger call --mod github.com/aweris/daggerverse/[email protected] run --token=cmd:"echo $GITHUB_API_TOKEN" --cmd="issue list --repo=dagger/dagger" stdout


Error: response from query: input: container.from.withFile.withEntrypoint.withEnvVariable.withEnvVariable.withSecretVariable.withExec.stdout resolve: process "sh -c /usr/local/bin/gh issue list --repo=dagger/dagger" did not complete successfully: exit code: 1

Stderr:
Post "https://api.github.com/graphql": net/http: invalid header field value for "Authorization"

Same for reading the secret from file:

echo $GITHUB_API_TOKEN > .my-token
dagger call --mod github.com/aweris/daggerverse/[email protected] run --token=file:./.my-token --cmd="issue list --repo=dagger/dagger" stdout

It fails with the same error as cmd.

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