Skip to content

Conversation

@cweinberger
Copy link
Member

@cweinberger cweinberger commented Jan 16, 2026

Summary

Adds automatic tracking of commits pending production deployment via a persistent GitHub issue with color-coded status indicators. Provides an at-a-glance view of what changes are ready to deploy.

Why? Relevant for repositories where we do manual production releases.

Example Tracker: https://github.com/monta-app/service-vehicle/issues/299
Example Usage: https://github.com/monta-app/service-vehicle/blob/main/.github/workflows/track-pending-release.yml

Screenshot 2026-01-16 at 13 47 11

What It Does

Creates and maintains a single GitHub issue that automatically updates to show:

  • Current deployment status (🟢/🟡/🔴 emoji in title)
  • List of commits on main that haven't been deployed to production yet
  • Links to commits, diffs, and deployment workflow
  • Direct instructions to trigger production deployment via GitHub Actions UI

Status Indicators

The issue title updates automatically based on pending commits:

  • 🟢 Green (0 commits) - Production is up-to-date with main
  • 🟡 Yellow (1 commit) - One commit pending deployment
  • 🔴 Red (>1 commits) - Multiple commits pending deployment

This provides instant visibility in the issue list - you can see deployment status at a glance.

Example Issue States

When Up-to-Date (🟢)

Title: 🟢 Production Release Tracker

## 🟢 Recently Released

Status: ✅ Up-to-date - Production is in sync with main

Latest Production Deploy:
- Tag: 2026-01-16-12-30
- Commit: abc123de

All changes on main have been deployed to production.

When Commits Are Pending (🔴)

Title: 🔴 Production Release Tracker

## 🔴 Pending Release Changelog

Status: ⚠️ 3 commits pending deployment

Latest Production Deploy:
- Tag: 2026-01-16-12-30
- Commit: abc123de

Current Main Branch:
- Commit: def456gh

### 📝 Commits Pending Deployment

- [def456g] feat: add new feature by @developer1
- [789abcd] fix: resolve bug by @developer2
- [e1f2g3h] chore: update deps by @developer3

---

To deploy these changes to production:

1. Go to Actions > Deploy Production
2. Click "Run workflow"
3. Select branch: main
4. Click "Run workflow"

[View full diff]

How It Works

  1. Tracks Deployment State: Compares latest production release tag with main branch HEAD
  2. Updates Automatically: Runs on every push to main and after production deployments
  3. Persistent Issue: Creates/updates a single issue (no spam from closing/reopening)
  4. Dynamic Title: Issue title changes to show status emoji for quick scanning

Triggers

The workflow runs on:

on:
  push:
    branches:
      - main       # Tracks new commits
    tags:
      - '*'        # Manual tag pushes
  workflow_dispatch: # Manual trigger
  workflow_run:
    workflows: ["Deploy Production"]
    types:
      - completed  # After automated deployments

Note: The workflow_run trigger is required because enable-release-tag creates tags using GITHUB_TOKEN, which doesn't trigger other workflows (GitHub Actions limitation). This ensures the issue updates immediately after production deployments.

Benefits

  1. At-a-glance visibility: Issue title shows deployment status in your issue list
  2. No "what are we releasing?" questions: Team can see exactly what's pending
  3. Easy deployment: Direct link to trigger workflow dispatch
  4. No notification spam: Issue stays open, updates in-place
  5. Full traceability: Links to commits, authors, and full diff
  6. Team coordination: Pin the issue for easy team access

Technical Details

  • Label: Creates and uses pending-release label (🟠 orange)
  • Comparison Method: Uses GitHub API compare endpoint
  • Tag Source: Reads from latest git tag (requires enable-release-tag: true)
  • Permissions: Uses GITHUB_TOKEN (automatically provided)
  • Reopening: Automatically reopens issue if it was previously closed

Integration

Works seamlessly with existing deployment workflows:

  • enable-release-tag: true - Creates tags this workflow tracks
  • enable-changelog: true - Generates release notes after deploy
  • Tag-based production deployments

Setup

After merging, the workflow will:

  1. Run automatically on the next push to main
  2. Create a pending-release label (if doesn't exist)
  3. Create the tracking issue
  4. Update on every push to main and production deployment

Recommended: Pin the issue to your repository for easy team access.

Testing

  1. Merge this PR
  2. Check Issues tab for new pending-release labeled issue
  3. Make a commit to main and verify issue updates
  4. Deploy to production and verify issue updates to 🟢 status

- Add track-pending-release.yml reusable workflow
- Dynamic emoji status indicators (🟢/🟡/🔴)
- Configurable main branch and production workflow
- Keeps issue open with updated content
- Includes comprehensive documentation in workflow-guide.md

Features:
- Compares latest production tag with main branch
- Creates/updates persistent GitHub issue
- Updates title with status emoji
- Shows 'Recently Released' when up-to-date
- Shows 'Pending Release Changelog' with commit list
- Links to GitHub Actions UI for deployment
- Automatically reopens if previously closed

Inputs:
- main-branch (default: 'main')
- production-workflow (default: 'deploy-production.yml')

Usage: Services call this workflow to track pending releases
- Clarify purpose: for manual production releases, at-a-glance view
- Reduce documentation depth while keeping essential info
- Remove verbose examples, keep concise 'What it looks like' section
- Streamline best practices
Add workflow_run trigger to example and explain why it's needed.

The enable-release-tag feature creates tags using GITHUB_TOKEN,
which doesn't trigger other workflows (GitHub Actions limitation).
Using workflow_run ensures the tracker updates immediately after
production deployments complete.
Copy link
Contributor

@MithrandirDK MithrandirDK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this

- Quote all variables to prevent word splitting (SC2086)
- Use { cmd; } >> file blocks instead of individual redirects (SC2129)
- Quote GITHUB_OUTPUT variable consistently
- Quote API endpoints with variables

All shellcheck issues resolved.
@cweinberger cweinberger merged commit d0c90fd into main Jan 16, 2026
1 check passed
@cweinberger cweinberger deleted the feat/track-pending-release-changes branch January 16, 2026 13:01
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