Skip to content

Commit

Permalink
Encode password before use it
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoVictor committed Jul 10, 2024
1 parent 963fd4b commit 1a6fee8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports.handler = async () => {
const { username, password } = await secretManager.getSecret(
process.env.CLUSTER_SECRET_ID
);
const DATABASE_URL = `postgresql://${username}:${password}@${process.env.CLUSTER_URL}/coderunner?schema=public`;
const pass = encodeURIComponent(password);
const DATABASE_URL = `postgresql://${username}:${pass}@${process.env.CLUSTER_URL}/coderunner?schema=public`;

const output = execSync(
`DATABASE_URL="${DATABASE_URL}" ./node_modules/.bin/prisma migrate deploy`
Expand Down

0 comments on commit 1a6fee8

Please sign in to comment.