Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/integration-pg-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Python + pgTAP Integration (PG15-PG18)

on:
workflow_dispatch:
pull_request:
pull_request_target:
types: [opened, synchronize]
paths:
- pgFirstAid.sql
Expand All @@ -18,7 +18,6 @@ concurrency:

jobs:
integration:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
runs-on: [self-hosted, nix, nixos, x86_64-linux]
permissions:
contents: read
Expand Down Expand Up @@ -49,6 +48,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Add Nix profile paths
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/neon-before-after-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# NEON_PROJECT_ID -- from your Neon project's Settings page
#
# Change files:
# When triggered on pull_request, the workflow auto-discovers .sql files
# When triggered on pull_request_target, the workflow auto-discovers .sql files
# under migrations/ and applies them as the change. For app or infra
# changes, use workflow_dispatch and either:
# (a) pass your SQL files via the `change_files` input, or
Expand All @@ -42,7 +42,7 @@
name: Neon Before/After Validation

on:
pull_request:
pull_request_target:
paths:
- 'migrations/**'
- 'pgFirstAid.sql'
Expand Down Expand Up @@ -81,6 +81,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}

- name: Install PostgreSQL client
run: |
Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:
echo " Pre-change baseline captured above."
echo ""
echo " The change being tested:"
echo " ${{ github.event_name == 'pull_request' && format('PR #{0}', github.event.number) || 'manual dispatch' }}"
echo " ${{ github.event_name == 'pull_request_target' && format('PR #{0}', github.event.number) || 'manual dispatch' }}"
echo ""
echo " Now applying SQL changes..."
echo ""
Expand Down Expand Up @@ -231,7 +232,7 @@ jobs:
fi

- name: Post PR comment
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/github-script@v7
with:
script: |
Expand Down
1 change: 1 addition & 0 deletions pgFirstAid.sql
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ from
q
where
bloat_pct > 50.0
and bloat_size > pg_size_bytes('10 MB')
and schemaname not like all(array['information_schema', 'pg_catalog', 'pg_toast', 'pg_temp%'])
order by
quote_ident(schemaname),
Expand Down
3 changes: 2 additions & 1 deletion view_pgFirstAid.sql
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ from
q
where
bloat_pct > 50.0
and schemaname not like all(array['information_schema', 'pg_catalog', 'pg_toast', 'pg_temp%'])
Comment thread
randoneering marked this conversation as resolved.
and bloat_size > pg_size_bytes('10 MB')
and schemaname not like all(array['information_schema', 'pg_catalog', 'pg_toast', 'pg_temp%'])
order by
quote_ident(schemaname),
quote_ident(tblname))
Expand Down
3 changes: 2 additions & 1 deletion view_pgFirstAid_managed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ from
q
where
bloat_pct > 50.0
and schemaname not like all(array['information_schema', 'pg_catalog', 'pg_toast', 'pg_temp%'])
and bloat_size > pg_size_bytes('10 MB')
and schemaname not like all(array['information_schema', 'pg_catalog', 'pg_toast', 'pg_temp%'])
order by
quote_ident(schemaname),
quote_ident(tblname))
Expand Down
9 changes: 5 additions & 4 deletions workflows/neon-before-after-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# NEON_PROJECT_ID -- from your Neon project's Settings page
#
# Change files:
# When triggered on pull_request, the workflow auto-discovers .sql files
# When triggered on pull_request_target, the workflow auto-discovers .sql files
# under migrations/ and applies them as the change. For app or infra
# changes, use workflow_dispatch and either:
# (a) pass your SQL files via the `change_files` input, or
Expand All @@ -42,7 +42,7 @@
name: Neon Before/After Validation

on:
pull_request:
pull_request_target:
paths:
- 'migrations/**'
- 'pgFirstAid.sql'
Expand Down Expand Up @@ -81,6 +81,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}

- name: Install PostgreSQL client
run: |
Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:
echo " Pre-change baseline captured above."
echo ""
echo " The change being tested:"
echo " ${{ github.event_name == 'pull_request' && format('PR #{0}', github.event.number) || 'manual dispatch' }}"
echo " ${{ github.event_name == 'pull_request_target' && format('PR #{0}', github.event.number) || 'manual dispatch' }}"
echo ""
echo " Now applying SQL changes..."
echo ""
Expand Down Expand Up @@ -231,7 +232,7 @@ jobs:
fi

- name: Post PR comment
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/github-script@v7
with:
script: |
Expand Down
Loading