Back to changelog
Improvement
•2 minute read

GitHub Actions: Change Summary in Pull Request Comments

The schema/plan and migrate/lint actions now add a change summary to their pull request comments: one row for each changed object, with its diff and the statements that change it.

From v1.17.4, the pull request comments of schema/plan and migrate/lint include a change summary: every object the change creates, modifies, or drops, with its diff and the statements that touch it. Reviewers see what changes before reading the SQL.

No workflow changes are needed. The summary comes with the latest Atlas version, which ariga/setup-atlas installs by default.

Schema Plan

The plan comment opens with the summary, followed by the full migration script:

schema/plan comment
▾ Change summary · 6 objects: 1 added, 4 modified, 1 dropped · 17 statements
Object
Diff
Statements
~ table "users"
`id` integer NOT NULL,
- `name` text NULL,
+ `name` text NOT NULL,
PRIMARY KEY (`id`)
▸ 4 statements
~ table "orders"
`total` integer NOT NULL,
+ `updated_at` text NULL,
PRIMARY KEY (`id`)
▸ 2 statements
~ table "order_events"
`payload` text NULL,
- `retries` integer NOT NULL DEFAULT 0,
+ `retries` integer NOT NULL DEFAULT 3,
`processed_at` text NULL,
▸ 3 statements
~ table "order_totals"
▸ +24 -24
▸ 2 statements
- table "exports"
▸ -4
▸ 1 statement
+ table "order_notes"
▸ +6
▸ 1 statement
other statements
▸ 4 statements
▸ Migration script · 17 statements, 92 lines

Migrate Lint

The lint comment adds a summary for each migration file, below the lint results:

migrate/lint comment
▸ Changes in 20261001000000_init.sql · 6 objects: 6 added · 11 statements
▾ Changes in 20261002000000_users.sql · 3 objects: 1 added, 2 modified · 4 statements
Object
Diff
Statements
~ table "users"
`name` text NULL,
+ `email` text NULL,
PRIMARY KEY (`id`)
);
+CREATE UNIQUE INDEX `users_email` ON `users` (`email`);
▸ 2 statements
~ table "orders"
);
+CREATE INDEX `orders_user_id` ON `orders` (`user_id`);
▸ 1 statement
+ table "order_notes"
▸ +6
▸ 1 statement
▸ Changes in 20261004000000_rebuild.sql · 3 objects: 2 modified, 1 dropped · 6 statements
▸ Changes in 20261005000000_bulk.sql · 20 objects: 20 added · 20 statements

Both actions also add the summary to the job summary. See the GitHub Actions documentation for more details.

improvementgithub-actionsschema planmigrate lintci