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

circleci context store-secret -> adds at the end of the value "," #749

Open
bogdanrn opened this issue Jul 13, 2022 · 1 comment
Open

circleci context store-secret -> adds at the end of the value "," #749

bogdanrn opened this issue Jul 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@bogdanrn
Copy link

Meta:

circleci context store-secret github my-org my-context my-env <<< "production"

CircleCI CLI Version: 0.1.19666+830e7ff (release)

Operating System: Mac OS 12.4

CircleCI CLI Diagnostic:

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /Users/bogdan/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API...
Ok.
Hello, Bogdan Radu.

Current behavior:

circleci context store-secret github my-org my-context MY_ENV <<< "production"

$MY_ENV will be set as production,

Expected behavior:

$MY_ENV should be production not production,

When did this begin / Was this previously working?:

before upgrading cli to version 0.1.19666+830e7ff (release) it worked as expcted

Additional Information:

I was using a node script to call the context updater

#!/usr/bin/env node

const { execSync } = require("child_process");
const config = {
  MY_ENV: 'production',
  MY_FIRST_VAR: 'TEST-1'
}

const contextName = 'myContext';
const orgName = 'myOrg';


for (key in config) {
  const value = config[key];
  console.log(`Setting key ${contextName}[${key}]=${value}`);

  try {
    const cmd = `circleci context store-secret github ${orgName} ${contextName} ${key} <<< "${value}"`;
    console.log(execSync(cmd).toString());
  } catch (error) {
    console.log(
      `Key: ${key} Status Code: ${error.status} with '${error.message}'`
    );
  }
}
@bogdanrn bogdanrn added the bug Something isn't working label Jul 13, 2022
@Maxim-Filimonov
Copy link

I do wonder if circleci team responds to those bugs at all.
This issue has been in the issue tracker for 2 years and we have just lost a day investigating the source of weirdest failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants