Skip to content

Commit

Permalink
fix: read env in handler from context
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Dec 25, 2024
1 parent a2aedc2 commit 7f652ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/handlers/call-personal-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ export async function callPersonalAgent(context: Context, inputs: PluginInputs)
throw new Error(`No personal agent config found on ${personalAgentOwner}/personal-agent`);
}

if (!process.env.X25519_PRIVATE_KEY) {
if (!context.env.X25519_PRIVATE_KEY) {
throw new Error(`Missing X25519_PRIVATE_KEY in bridge repository secrets.`);
}

const patDecrypted = await decryptKeys(personalAgentConfig.config.GITHUB_PAT_ENCRYPTED, process.env.X25519_PRIVATE_KEY, logger);
const patDecrypted = await decryptKeys(personalAgentConfig.config.GITHUB_PAT_ENCRYPTED, context.env.X25519_PRIVATE_KEY, logger);

const paOctokit = new Octokit({
auth: patDecrypted.decryptedText,
Expand Down
2 changes: 1 addition & 1 deletion tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function createContextInner(
} as Context["payload"],
logger: new Logs("debug"),
config: {},
env: {} as Env,
env: process.env,
octokit: octokit,
};
}

0 comments on commit 7f652ed

Please sign in to comment.