Skip to content

Conversation

@vilsonrodrigues
Copy link
Contributor

Summary

Removed the entire update-command job from the merge-bot workflow as it does not work for PRs from forks and never will due to GitHub security restrictions.

Problem

The /update command was designed to automatically merge the base branch into PR branches. However, it fails for all fork PRs because:

  1. ❌ GitHub Actions cannot push to fork repositories (security restriction)
  2. ❌ Even with PAT tokens, cross-repository writes are blocked
  3. ❌ This is by design and cannot be worked around

Current Behavior (Before This PR)

When users try /update on fork PRs, they get:

ℹ️ Update commands are not supported for PRs from forks.

To update your branch, please run these commands locally:
...

This creates confusion and adds 369 lines of non-functional code.

Solution

Removed the entire update-command job (369 lines deleted).

Impact

✅ Benefits

  • No more confusing "not supported" messages
  • Cleaner codebase (removed non-functional code)
  • Clear expectations: forks must update manually

ℹ️ For Contributors

To update your fork's PR branch:

git fetch upstream main
git merge upstream/main  
git push

Or use GitHub's "Update branch" button (available for some fork PRs).

⚠️ Limitation

The /update command only worked for same-repo branches anyway. Since most contributions come from forks, this feature was rarely usable.

Alternative Approaches Considered

  1. Use PAT with elevated permissions - ❌ Violates security principles
  2. Request users grant workflow permissions - ❌ Complex, error-prone
  3. Keep code with better error message - ❌ Maintaining 369 lines for an error message doesn't make sense

Files Changed

  • .github/workflows/merge-bot.yml - Removed update-command job (369 lines deleted)

Testing

  • Workflow file is valid YAML
  • Remaining /merge command still works
  • No references to removed job in other workflows

🤖 Generated with Claude Code

vilsonrodrigues and others added 10 commits November 27, 2025 02:18
- Complete project structure overview
- Common commands and workflows
- Release process (always use ./scripts/release.sh)
- Architecture details and optimizations
- Linting, testing, and CI/CD guides
- Troubleshooting tips

This file provides context for Claude Code to work more effectively
with the project without repeating instructions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removed the entire `update-command` job from merge-bot workflow.

**Reason:**
The `/update` command does not work for PRs from forks due to GitHub
security restrictions. GitHub Actions cannot push to fork repositories,
so the command always fails with a permission error.

**Impact:**
- Removed 369 lines of non-functional code
- Users will no longer see confusing "not supported for forks" messages
- Maintainers can still update branches manually with git commands

**For contributors:**
To update your fork's branch with upstream changes:
```bash
git fetch upstream main
git merge upstream/main
git push
```

This is the only reliable way to update fork PRs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vilsonrodrigues
Copy link
Contributor Author

vilsonrodrigues commented Dec 3, 2025

/merge

@vilsonrodrigues vilsonrodrigues merged commit 3964e50 into msgflux:main Dec 3, 2025
10 checks passed
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.

1 participant