Skip to content

Document advanced usage with Merge Queue #2

@aldenquimby

Description

@aldenquimby

Github's new merge queue does not set $GITHUB_BASE_REF or $GITHUB_HEAD_REF, so the example Find modified migrations does not work

The best I've found is to use dorny/paths-filter like this:

name: Lint Migrations

on:
  pull_request:
  merge_group:

jobs:
  lint_migrations:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      # Works on Pull Request and Merge Queue
      - name: Find modified migrations
        uses: dorny/paths-filter@4067d885736b84de7c414f582ac45897079b0a78
        id: modified-migrations
        with:
          base: ${{ github.event.merge_group.base_ref}}
          ref: ${{ github.event.merge_group.head_ref }}
          list-files: shell
          filters: |
            migrations:
              - migrations/**/*.sql
      - uses: sbdchd/squawk-action@v1
        with:
          pattern: ${{ steps.modified-migrations.outputs.migrations_files }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions