Skip to content

Commit

Permalink
migrate to js action
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoireW committed Oct 15, 2024
1 parent a3f9eed commit aa20592
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions dblinter-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const core = require('@actions/core');
const exec = require('@actions/exec');
const github = require('@actions/github');
const docker = require('docker-cli-js');
const crypto = require("node:crypto");

function buildReport(reportPath) {
const actualContent = JSON.parse(fs.readFileSync(reportPath, "utf-8"));
Expand Down Expand Up @@ -132,14 +133,14 @@ function validateInput(){
}

async function downloadDockerImage(config){
docker.dockerCommand('pull decathlon/dblinter:'+config.dblinterVersion);
docker.dockerCommand('pull flyway/flyway:'+config.flywayVersion);
await docker.dockerCommand('pull postgres:'+config.postgresVersion);
docker.dockerCommand('pull -q decathlon/dblinter:'+config.dblinterVersion);
docker.dockerCommand('pull -q flyway/flyway:'+config.flywayVersion);
await docker.dockerCommand('pull -q postgres:'+config.postgresVersion);
}


async function launchPostgres(config) {
const pgPass = Buffer.from(crypto.randomBytes(12)).toString('base64').replace(/\//g, '_');
const pgPass = crypto.randomBytes(16).toString('hex');
core.setSecret(pgPass);

const container=await docker.dockerCommand(`run -d -e POSTGRES_PASSWORD=${pgPass} postgres:${config.postgresVersion}`);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit aa20592

Please sign in to comment.