Skip to content

feat: add reusable GitHub Actions workflows#1

Merged
grdsdev merged 2 commits into
mainfrom
feat/reusable-workflows
Jan 21, 2026
Merged

feat: add reusable GitHub Actions workflows#1
grdsdev merged 2 commits into
mainfrom
feat/reusable-workflows

Conversation

@grdsdev

@grdsdev grdsdev commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds four reusable GitHub Actions workflows that can be shared across Supabase repositories, reducing duplication and standardizing common CI/CD patterns.

New Reusable Workflows

1. Block WIP/Draft Merges (.github/workflows/block-merge.yml)

Prevents accidental merging of incomplete work by blocking:

  • Draft PRs
  • PRs with configurable block labels (default: do-not-merge)
  • PRs with keywords in title (default: wip, do not merge)

2. Stale Issue Management (.github/workflows/stale.yml)

Automatically manages inactive issues and PRs with:

  • Configurable timelines (default: 180d for issues, 90d for PRs)
  • Exemptions for labeled, assigned, or milestone items
  • Different handling for different categories
  • Rate limiting for large repositories

3. Auto-Label Issues and PRs (.github/workflows/label-issues.yml)

Automatically applies labels based on content:

  • For PRs: Extracts scope from conventional commit format (fix(auth):auth label)
  • For Issues: Parses issue template content for affected modules
  • Custom mappings: Supports JSON configuration for label mappings

4. Slack Notifications (.github/workflows/slack-notify.yml)

Sends rich Slack notifications with:

  • Formatted messages with status indicators (✅/❌/ℹ️)
  • Repository, workflow, and commit information
  • Action buttons for quick access
  • Optional version and group mentions

Benefits

  • Consistency: Standard workflows across all Supabase repos
  • Maintainability: Single source of truth for common patterns
  • Flexibility: Configurable inputs for repo-specific needs
  • Reusability: Easy to consume via workflow_call

Usage Example

name: Block WIP Merges
on:
  pull_request:
    types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
  block-merge:
    uses: supabase/actions/.github/workflows/block-merge.yml@main
    with:
      block_labels: 'do-not-merge'
      block_keywords: 'wip,do not merge'

Documentation

Comprehensive README updated with:

  • Usage examples for each workflow
  • Input parameter documentation
  • Best practices for versioning and permissions
  • Contributing guidelines

Testing Plan

After merge, these workflows will be tested by integrating them into:

  1. supabase-swift repository
  2. supabase-js repository
  3. Other Supabase repositories as needed

Related

This supports the ongoing effort to standardize CI/CD practices across Supabase repositories and was developed based on patterns from supabase-js.


Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Add four reusable workflows for use across Supabase repositories:

1. block-merge.yml - Prevents merging of WIP/draft PRs
   - Blocks draft PRs
   - Blocks PRs with specific labels (configurable)
   - Blocks PRs with keywords in title (configurable)

2. stale.yml - Manages stale issues and PRs
   - Configurable timelines for issues vs PRs
   - Exempts labeled/assigned items
   - Different handling for different label categories

3. label-issues.yml - Auto-labels issues and PRs
   - Extracts scope from conventional commit PR titles
   - Parses issue templates for affected modules
   - Supports custom label mappings via JSON input

4. slack-notify.yml - Sends rich Slack notifications
   - Supports success/failure/info statuses
   - Includes repository, workflow, and commit info
   - Action buttons for quick access

Also updated README with comprehensive documentation including:
- Usage examples for each workflow
- Input parameter documentation
- Best practices for versioning and permissions
- Contributing guidelines

These workflows can now be consumed by supabase-swift, supabase-js,
and other Supabase repositories using the workflow_call pattern.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
grdsdev added a commit to supabase/supabase-js that referenced this pull request Jan 21, 2026
Refactor CI workflows to use shared reusable workflows from the
supabase/actions repository, standardizing patterns across Supabase repos.

Changes:
1. block-merge.yml - Now uses supabase/actions/.github/workflows/block-merge.yml
   - Same functionality, simplified implementation
   - Prevents merging of draft PRs, PRs with do-not-merge label, or WIP in title

2. label-issues.yml - Now uses supabase/actions/.github/workflows/label-issues.yml
   - Extracts scope from conventional commit PR titles
   - Labels: auth-js, functions-js, postgrest-js, storage-js, realtime-js, supabase-js
   - Simplified from 107 lines to 26 lines

Kept as-is:
- stale.yml - Has sophisticated multi-tier stale handling specific to this repo
- slack-notify.yml - Already a reusable workflow, uses repo-specific secrets
- Other workflows (ci.yml, docs.yml, publish.yml, etc.) - Repo-specific logic

Benefits:
- Easier maintenance (single source of truth)
- Consistent behavior across Supabase repositories
- Automatic updates when supabase/actions workflows improve
- Reduced duplication

Related:
- Reusable workflows: supabase/actions#1
- supabase-swift adoption: supabase/supabase-swift#887

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@grdsdev grdsdev requested a review from staaldraad January 21, 2026 14:56
@grdsdev grdsdev merged commit 659b3cd into main Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants