adamant-solstice-35288
12/04/2024, 5:19 PMsyncEnv.ymlimports:
  - case-traders/cms
values:
  sync:
    githubSecrets:
      - name: CMS_GITHUB_TOKEN
        value: ${CMS_GITHUB_TOKEN}
      - name: CMS_REPO
        value: ${CMS_REPO}
      - name: CMS_REPO_OWNER
        value: ${CMS_REPO_OWNER}
      - name: CMS_USERNAME
        value: ${CMS_USERNAME}
      - name: CMS_PASSWORD
        value: ${CMS_PASSWORD}pulumi upType                                Name                         Status                  Info
     pulumi:pulumi:Stack                 esc-sync-github-secrets-dev  **failed**              1 error
 +   └─ pulumiservice:index:Environment  env                          **creating failed**     1 error
Diagnostics:
  pulumi:pulumi:Stack (esc-sync-github-secrets-dev):
    error: update failed
  pulumiservice:index:Environment (env):
    error: failed to check environment due to error: [0]
    Diags: unknown property "CMS_GITHUB_TOKEN"
    unknown property "CMS_REPO"
    unknown property "CMS_REPO_OWNER"
    unknown property "CMS_USERNAME"
    unknown property "CMS_PASSWORD"
    [Pulumi Copilot] Would you like help with these diagnostics?
    <https://app.pulumi.com/case-traders/esc-sync-github-secrets/dev/updates/2?explainFailure>
Resources:
    2 unchanged
Duration: 3sred-match-15116
12/04/2024, 5:27 PMgithubSecretsgithubSecretsadamant-solstice-35288
12/04/2024, 5:40 PMtarget/index.tsimport * as pulumi from "@pulumi/pulumi";import * as github from "@pulumi/github";
import * as fs from "fs";
const config = new pulumi.Config();
const repository = config.require("repository");
const secretsFile = "sync.json";
const secretsConfig = JSON.parse(fs.readFileSync(secretsFile, "utf8"));
if (!Array.isArray(secretsConfig.githubSecrets)) {
  throw new Error("Invalid secrets configuration. Expected a list of secrets under `githubSecrets`.");
}
const secrets = secretsConfig.githubSecrets.map((secret:Record<string, string>) => {
  if (!secret.name || !secret.value) {
    throw new Error(`Invalid secret entry: ${JSON.stringify(secret)}`);
  }
  return new github.ActionsSecret(`githubSecret-${secret.name}`, {
    repository,
    secretName: secret.name,
    plaintextValue: secret.value,
  });
});
export const secretNames = secrets.map((secret) => secret.secretName);red-match-15116
12/04/2024, 5:41 PMindex.tsgithubSecretsadamant-solstice-35288
12/04/2024, 5:42 PMindex.tsoperationContext: {
    preRunCommands: [
      "pulumi login",
      pulumi
        .interpolate`pulumi config env add ${projectName}/${env.name} -s ${fullyQualifiedStackName} --yes`,
      pulumi
        .interpolate`pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets.value > sync.json`,
      pulumi
        .interpolate`pulumi config set -s ${fullyQualifiedStackName} secretName $(pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets.name)`,
    ],
  },adamant-solstice-35288
12/04/2024, 5:43 PMred-match-15116
12/04/2024, 5:43 PMgithubSecretstarget/index.tsadamant-solstice-35288
12/04/2024, 5:43 PMopenpulumi
        .interpolate`pulumi config set -s ${fullyQualifiedStackName} secretName $(pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets.name)`,adamant-solstice-35288
12/04/2024, 5:44 PMpulumi
        .interpolate`pulumi config set -s ${fullyQualifiedStackName} secretName $(pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets.name)`,red-match-15116
12/04/2024, 5:45 PMsecretNameadamant-solstice-35288
12/04/2024, 5:47 PMpulumi
        .interpolate`pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets > sync.json`,adamant-solstice-35288
12/04/2024, 5:47 PMerror: update failed
  pulumiservice:index:Environment (env):
    error: failed to check environment due to error: [0]
    Diags: unknown property "CMS_GITHUB_TOKEN"
    unknown property "CMS_REPO"
    unknown property "CMS_REPO_OWNER"
    unknown property "CMS_USERNAME"
    unknown property "CMS_PASSWORD"adamant-solstice-35288
12/04/2024, 5:48 PMadamant-solstice-35288
12/04/2024, 5:48 PMname        : "dev"
        organization: "case-traders"
        project     : "case-traders"
        yaml        : (yaml) {
            imports: [
                [0]: "case-traders/cms"
            ]
            values : {
                sync: {
                    githubSecrets: [
                        [0]: {
                            name : "CMS_GITHUB_TOKEN"
                            value: "${CMS_GITHUB_TOKEN}"
                        }
                        [1]: {
                            name : "CMS_REPO"
                            value: "${CMS_REPO}"
                        }
                        [2]: {
                            name : "CMS_REPO_OWNER"
                            value: "${CMS_REPO_OWNER}"
                        }
                        [3]: {
                            name : "CMS_USERNAME"
                            value: "${CMS_USERNAME}"
                        }
                        [4]: {
                            name : "CMS_PASSWORD"
                            value: "${CMS_PASSWORD}"
                        }
                    ]
                }
            }
        }adamant-solstice-35288
12/04/2024, 5:49 PMred-match-15116
12/04/2024, 5:52 PMpulumi.interpolate`pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets.value > sync.json`sync.jsonpulumi.interpolate`pulumi config set -s ${fullyQualifiedStackName} secretName $(pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets.name)`secretNamered-match-15116
12/04/2024, 5:52 PMred-match-15116
12/04/2024, 5:53 PMindex.tspreRunCommands: [
            "pulumi login",
            pulumi.interpolate`pulumi config env add ${projectName}/${env.name} -s ${fullyQualifiedStackName} --yes`,
            pulumi.interpolate`pulumi env open ${fullyQualifiedEnvName} sync.githubSecrets > sync.json`,
        ],adamant-solstice-35288
12/04/2024, 5:54 PMred-match-15116
12/04/2024, 5:54 PMadamant-solstice-35288
12/04/2024, 5:55 PMred-match-15116
12/04/2024, 5:58 PMadamant-solstice-35288
12/04/2024, 5:59 PMred-match-15116
12/04/2024, 6:00 PMtarget/index.tsimport * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
import * as fs from "fs";
const config = new pulumi.Config();
const repository = config.require("repository");
const json = fs.readFileSync("sync.json", "utf8");
const secrets = JSON.parse(json);
for (const {name, value} of secrets) {
    const secret = new github.ActionsSecret(`githubSecret-${name}`, {
        repository,
        secretName: name,
        plaintextValue: value,
    });
}red-match-15116
12/04/2024, 6:03 PMadamant-solstice-35288
12/04/2024, 6:16 PMsync:
    githubSecrets:
      - name: CMS_GITHUB_TOKEN
        value: {CMS_GITHUB_TOKEN}
      - name: CMS_REPO
        value: {CMS_REPO}No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by