GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sbdchd/squawk-action: Github Action for Linting Postgres Migrations with Squawk

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu

Latest commit

 

History

26 Commits
26 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
CHANGELOG.md
CHANGELOG.md
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
example.sql
example.sql
 
 
squawk-pr-comment.png
squawk-pr-comment.png
 
 

Repository files navigation

squawk-action GitHub release (latest SemVer)

A GitHub Action for Squawk.

Lint Postgres migrations and report violations as a comment in a GitHub Pull Request (example PR).

For more information on Squawk, see the Squawk GitHub repository or website.

basic usage

Lint every .sql file in migrations/ on every pull request.

# .github/workflows/lint-migrations.yml
name: Lint Migrations

on: pull_request

jobs:
  lint_migrations:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: sbdchd/squawk-action@v2
        with:
          pattern: "migrations/*.sql"
          version: "latest"

advanced usage

Only lint modified .sql files in the migrations/.

# .github/workflows/lint-migrations.yml
name: Lint Migrations

on: pull_request

jobs:
  lint_migrations:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - name: Find modified migrations
        run: |
          modified_migrations=$(git diff --diff-filter=d --name-only origin/$GITHUB_BASE_REF...origin/$GITHUB_HEAD_REF 'migrations/*.sql' | tr '\n' ' ')
          echo "$modified_migrations"
          echo "file_names=$modified_migrations" >> $GITHUB_OUTPUT
        id: modified-migrations
      - uses: sbdchd/squawk-action@v2
        with:
          files: ${{ steps.modified-migrations.outputs.file_names }}

Tip

See action.yml for more action inputs.

example report

Example Squawk PR Comment

development

releasing a new version

  1. Release a new version (e.g. v5.2.1)
  2. Update major version tag to point to commit.
    git tag v5
    git push --tags

About

Github Action for Linting Postgres Migrations with Squawk

github.com/sbdchd/squawk

Topics

github-actionspostgres

Resources

Readme
Activity

Stars

14 stars

Watchers

1 watching

Forks

14 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.