Skip to content

Commit d9db2f2

Browse files
committed
chore: install pgbadger from repo
1 parent 7a2d87c commit d9db2f2

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

action.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,7 @@ runs:
3333
shell: bash
3434
run: |
3535
sudo apt-get update
36-
sudo apt-get install -y perl make wget
37-
38-
# Download, build, and install pgBadger
39-
- name: Download and Install pgBadger
40-
shell: bash
41-
run: |
42-
PGBADGER_VERSION=13.1
43-
cd /tmp
44-
wget https://github.com/darold/pgbadger/archive/v${PGBADGER_VERSION}.tar.gz -O pgbadger.tar.gz
45-
tar -xzf pgbadger.tar.gz
46-
cd pgbadger-${PGBADGER_VERSION}
47-
perl Makefile.PL
48-
sudo make install # Use sudo to install globally
49-
cd ${{ github.action_path }} # Return to action directory
36+
sudo apt-get install -y pgbadger
5037
5138
# Compile the Deno application into a single executable
5239
- name: Compile Analyzer

main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ async function main() {
5454
const stats = new Statistics(pg);
5555
const existingIndexes = await stats.getExistingIndexes();
5656
const optimizer = new IndexOptimizer(pg, existingIndexes);
57-
console.log(existingIndexes);
5857
const tables = await stats.dumpStats();
5958

59+
console.time("total");
6060
for await (const chunk of stream) {
6161
const [
6262
_timestamp,
@@ -181,9 +181,10 @@ async function main() {
181181
}
182182
}
183183
const reporter = new GithubReporter(
184-
process.env.GITHUB_TOKEN || core.getInput("github_token")
184+
core.getInput("github_token", { required: true })
185185
);
186186
await reporter.report({ recommendations });
187+
console.timeEnd("total");
187188
await output.status;
188189
console.log(`Ran ${matching} queries`);
189190
Deno.exit(0);

0 commit comments

Comments
 (0)